aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion
diff options
context:
space:
mode:
authorEric Moore <eric.moore@lsi.com>2007-09-14 20:46:51 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-12 14:48:34 -0400
commit29dd3609f2fc70e02ce48123485b14d9417b834f (patch)
tree54d4f8dc50dd8a45b37f66352a902fbf225b24c8 /drivers/message/fusion
parent685b9e02fb77c6f33319ca59c52ae67e92fb750c (diff)
[SCSI] mpt fusion: standardize printks and debug info
Standardize all prints using common MYIOC_s_XXX_FMT macro defined in mptbase.h. Currently the driver uses several different methods to display info, where in some cases the "controller name" generating the printk is not provided. Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion')
-rw-r--r--drivers/message/fusion/mptbase.c279
-rw-r--r--drivers/message/fusion/mptctl.c233
-rw-r--r--drivers/message/fusion/mptfc.c10
-rw-r--r--drivers/message/fusion/mptsas.c253
-rw-r--r--drivers/message/fusion/mptscsih.c140
-rw-r--r--drivers/message/fusion/mptspi.c54
6 files changed, 505 insertions, 464 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 635defd25925..2c904536b8b6 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -349,7 +349,7 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa)
349 349
350 dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got non-TURBO reply=%p req_idx=%x cb_idx=%x Function=%x\n", 350 dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got non-TURBO reply=%p req_idx=%x cb_idx=%x Function=%x\n",
351 ioc->name, mr, req_idx, cb_idx, mr->u.hdr.Function)); 351 ioc->name, mr, req_idx, cb_idx, mr->u.hdr.Function));
352 DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mr) 352 DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mr);
353 353
354 /* Check/log IOC log info 354 /* Check/log IOC log info
355 */ 355 */
@@ -451,8 +451,9 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
451#ifdef CONFIG_FUSION_LOGGING 451#ifdef CONFIG_FUSION_LOGGING
452 if ((ioc->debug_level & MPT_DEBUG_MSG_FRAME) && 452 if ((ioc->debug_level & MPT_DEBUG_MSG_FRAME) &&
453 !(reply->u.hdr.MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY)) { 453 !(reply->u.hdr.MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY)) {
454 dmfprintk(ioc, printk(KERN_INFO MYNAM ": Original request frame (@%p) header\n", mf)); 454 dmfprintk(ioc, printk(MYIOC_s_INFO_FMT ": Original request frame (@%p) header\n",
455 DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)mf) 455 ioc->name, mf));
456 DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)mf);
456 } 457 }
457#endif 458#endif
458 459
@@ -517,8 +518,8 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
517 u16 status; 518 u16 status;
518 519
519 status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK; 520 status = le16_to_cpu(pReply->IOCStatus) & MPI_IOCSTATUS_MASK;
520 dcprintk(ioc, printk(KERN_NOTICE " IOCStatus=%04xh, IOCLogInfo=%08xh\n", 521 dcprintk(ioc, printk(MYIOC_s_NOTE_FMT " IOCStatus=%04xh, IOCLogInfo=%08xh\n",
521 status, le32_to_cpu(pReply->IOCLogInfo))); 522 ioc->name, status, le32_to_cpu(pReply->IOCLogInfo)));
522 523
523 pCfg->status = status; 524 pCfg->status = status;
524 if (status == MPI_IOCSTATUS_SUCCESS) { 525 if (status == MPI_IOCSTATUS_SUCCESS) {
@@ -783,7 +784,8 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc)
783 784
784#ifdef MFCNT 785#ifdef MFCNT
785 if (!ioc->active) 786 if (!ioc->active)
786 printk(KERN_WARNING "IOC Not Active! mpt_get_msg_frame returning NULL!\n"); 787 printk(MYIOC_s_WARN_FMT "IOC Not Active! mpt_get_msg_frame "
788 "returning NULL!\n", ioc->name);
787#endif 789#endif
788 790
789 /* If interrupts are not attached, do not return a request frame */ 791 /* If interrupts are not attached, do not return a request frame */
@@ -804,7 +806,8 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc)
804 req_idx = req_offset / ioc->req_sz; 806 req_idx = req_offset / ioc->req_sz;
805 mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx); 807 mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx);
806 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; 808 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
807 ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; /* Default, will be changed if necessary in SG generation */ 809 /* Default, will be changed if necessary in SG generation */
810 ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame;
808#ifdef MFCNT 811#ifdef MFCNT
809 ioc->mfcnt++; 812 ioc->mfcnt++;
810#endif 813#endif
@@ -815,14 +818,17 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc)
815 818
816#ifdef MFCNT 819#ifdef MFCNT
817 if (mf == NULL) 820 if (mf == NULL)
818 printk(KERN_WARNING "IOC Active. No free Msg Frames! Count 0x%x Max 0x%x\n", ioc->mfcnt, ioc->req_depth); 821 printk(MYIOC_s_WARN_FMT "IOC Active. No free Msg Frames! "
822 "Count 0x%x Max 0x%x\n", ioc->name, ioc->mfcnt,
823 ioc->req_depth);
819 mfcounter++; 824 mfcounter++;
820 if (mfcounter == PRINT_MF_COUNT) 825 if (mfcounter == PRINT_MF_COUNT)
821 printk(KERN_INFO "MF Count 0x%x Max 0x%x \n", ioc->mfcnt, ioc->req_depth); 826 printk(MYIOC_s_INFO_FMT "MF Count 0x%x Max 0x%x \n", ioc->name,
827 ioc->mfcnt, ioc->req_depth);
822#endif 828#endif
823 829
824 dmfprintk(ioc, printk(KERN_INFO MYNAM ": %s: mpt_get_msg_frame(%d,%d), got mf=%p\n", 830 dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mpt_get_msg_frame(%d,%d), got mf=%p\n",
825 ioc->name, cb_idx, ioc->id, mf)); 831 ioc->name, cb_idx, ioc->id, mf));
826 return mf; 832 return mf;
827} 833}
828 834
@@ -855,7 +861,9 @@ mpt_put_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf)
855 DBG_DUMP_PUT_MSG_FRAME(ioc, (u32 *)mf); 861 DBG_DUMP_PUT_MSG_FRAME(ioc, (u32 *)mf);
856 862
857 mf_dma_addr = (ioc->req_frames_low_dma + req_offset) | ioc->RequestNB[req_idx]; 863 mf_dma_addr = (ioc->req_frames_low_dma + req_offset) | ioc->RequestNB[req_idx];
858 dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mf_dma_addr=%x req_idx=%d RequestNB=%x\n", ioc->name, mf_dma_addr, req_idx, ioc->RequestNB[req_idx])); 864 dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mf_dma_addr=%x req_idx=%d "
865 "RequestNB=%x\n", ioc->name, mf_dma_addr, req_idx,
866 ioc->RequestNB[req_idx]));
859 CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr); 867 CHIPREG_WRITE32(&ioc->chip->RequestFifo, mf_dma_addr);
860} 868}
861 869
@@ -1002,7 +1010,7 @@ mpt_send_handshake_request(u8 cb_idx, MPT_ADAPTER *ioc, int reqBytes, u32 *req,
1002 if (!(CHIPREG_READ32(&ioc->chip->Doorbell) & MPI_DOORBELL_ACTIVE)) 1010 if (!(CHIPREG_READ32(&ioc->chip->Doorbell) & MPI_DOORBELL_ACTIVE))
1003 return -5; 1011 return -5;
1004 1012
1005 dhsprintk(ioc, printk(KERN_INFO MYNAM ": %s: mpt_send_handshake_request start, WaitCnt=%d\n", 1013 dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mpt_send_handshake_request start, WaitCnt=%d\n",
1006 ioc->name, ii)); 1014 ioc->name, ii));
1007 1015
1008 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); 1016 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
@@ -1470,24 +1478,27 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1470 return -ENOMEM; 1478 return -ENOMEM;
1471 } 1479 }
1472 ioc->debug_level = mpt_debug_level; 1480 ioc->debug_level = mpt_debug_level;
1481 ioc->id = mpt_ids++;
1482 sprintf(ioc->name, "ioc%d", ioc->id);
1473 1483
1474 dinitprintk(ioc, printk(KERN_WARNING MYNAM ": mpt_adapter_install\n")); 1484 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": mpt_adapter_install\n", ioc->name));
1475 1485
1476 if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) { 1486 if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
1477 dprintk(ioc, printk(KERN_INFO MYNAM 1487 dprintk(ioc, printk(MYIOC_s_INFO_FMT
1478 ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n")); 1488 ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n", ioc->name));
1479 } else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { 1489 } else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
1480 printk(KERN_WARNING MYNAM ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n"); 1490 printk(MYIOC_s_WARN_FMT ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n",
1491 ioc->name);
1481 kfree(ioc); 1492 kfree(ioc);
1482 return r; 1493 return r;
1483 } 1494 }
1484 1495
1485 if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) { 1496 if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) {
1486 dprintk(ioc, printk(KERN_INFO MYNAM 1497 dprintk(ioc, printk(MYIOC_s_INFO_FMT
1487 ": Using 64 bit consistent mask\n")); 1498 ": Using 64 bit consistent mask\n", ioc->name));
1488 } else { 1499 } else {
1489 dprintk(ioc, printk(KERN_INFO MYNAM 1500 dprintk(ioc, printk(MYIOC_s_INFO_FMT
1490 ": Not using 64 bit consistent mask\n")); 1501 ": Not using 64 bit consistent mask\n", ioc->name));
1491 } 1502 }
1492 1503
1493 ioc->alloc_total = sizeof(MPT_ADAPTER); 1504 ioc->alloc_total = sizeof(MPT_ADAPTER);
@@ -1526,7 +1537,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1526 1537
1527 /* Find lookup slot. */ 1538 /* Find lookup slot. */
1528 INIT_LIST_HEAD(&ioc->list); 1539 INIT_LIST_HEAD(&ioc->list);
1529 ioc->id = mpt_ids++;
1530 1540
1531 mem_phys = msize = 0; 1541 mem_phys = msize = 0;
1532 port = psize = 0; 1542 port = psize = 0;
@@ -1552,15 +1562,15 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1552 /*mem = ioremap(mem_phys, msize);*/ 1562 /*mem = ioremap(mem_phys, msize);*/
1553 mem = ioremap(mem_phys, msize); 1563 mem = ioremap(mem_phys, msize);
1554 if (mem == NULL) { 1564 if (mem == NULL) {
1555 printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n"); 1565 printk(MYIOC_s_ERR_FMT "Unable to map adapter memory!\n", ioc->name);
1556 kfree(ioc); 1566 kfree(ioc);
1557 return -EINVAL; 1567 return -EINVAL;
1558 } 1568 }
1559 ioc->memmap = mem; 1569 ioc->memmap = mem;
1560 dinitprintk(ioc, printk(KERN_INFO MYNAM ": mem = %p, mem_phys = %lx\n", mem, mem_phys)); 1570 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "mem = %p, mem_phys = %lx\n", ioc->name, mem, mem_phys));
1561 1571
1562 dinitprintk(ioc, printk(KERN_INFO MYNAM ": facts @ %p, pfacts[0] @ %p\n", 1572 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "facts @ %p, pfacts[0] @ %p\n",
1563 &ioc->facts, &ioc->pfacts[0])); 1573 ioc->name, &ioc->facts, &ioc->pfacts[0]));
1564 1574
1565 ioc->mem_phys = mem_phys; 1575 ioc->mem_phys = mem_phys;
1566 ioc->chip = (SYSIF_REGS __iomem *)mem; 1576 ioc->chip = (SYSIF_REGS __iomem *)mem;
@@ -1642,8 +1652,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1642 if (ioc->errata_flag_1064) 1652 if (ioc->errata_flag_1064)
1643 pci_disable_io_access(pdev); 1653 pci_disable_io_access(pdev);
1644 1654
1645 sprintf(ioc->name, "ioc%d", ioc->id);
1646
1647 spin_lock_init(&ioc->FreeQlock); 1655 spin_lock_init(&ioc->FreeQlock);
1648 1656
1649 /* Disable all! */ 1657 /* Disable all! */
@@ -1660,9 +1668,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1660 1668
1661 if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP, 1669 if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
1662 CAN_SLEEP)) != 0){ 1670 CAN_SLEEP)) != 0){
1663 printk(KERN_WARNING MYNAM 1671 printk(MYIOC_s_ERR_FMT "didn't initialize properly! (%d)\n",
1664 ": WARNING - %s did not initialize properly! (%d)\n", 1672 ioc->name, r);
1665 ioc->name, r);
1666 1673
1667 list_del(&ioc->list); 1674 list_del(&ioc->list);
1668 if (ioc->alt_ioc) 1675 if (ioc->alt_ioc)
@@ -1888,8 +1895,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1888 int irq_allocated = 0; 1895 int irq_allocated = 0;
1889 u8 *a; 1896 u8 *a;
1890 1897
1891 printk(KERN_INFO MYNAM ": Initiating %s %s\n", 1898 printk(MYIOC_s_INFO_FMT "Initiating %s\n", ioc->name,
1892 ioc->name, reason==MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery"); 1899 reason == MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery");
1893 1900
1894 /* Disable reply interrupts (also blocks FreeQ) */ 1901 /* Disable reply interrupts (also blocks FreeQ) */
1895 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); 1902 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
@@ -1910,21 +1917,19 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1910 1917
1911 if ((hard_reset_done = MakeIocReady(ioc, hard, sleepFlag)) < 0) { 1918 if ((hard_reset_done = MakeIocReady(ioc, hard, sleepFlag)) < 0) {
1912 if (hard_reset_done == -4) { 1919 if (hard_reset_done == -4) {
1913 printk(KERN_WARNING MYNAM ": %s Owned by PEER..skipping!\n", 1920 printk(MYIOC_s_WARN_FMT "Owned by PEER..skipping!\n",
1914 ioc->name); 1921 ioc->name);
1915 1922
1916 if (reset_alt_ioc_active && ioc->alt_ioc) { 1923 if (reset_alt_ioc_active && ioc->alt_ioc) {
1917 /* (re)Enable alt-IOC! (reply interrupt, FreeQ) */ 1924 /* (re)Enable alt-IOC! (reply interrupt, FreeQ) */
1918 dprintk(ioc, printk(KERN_INFO MYNAM 1925 dprintk(ioc, printk(MYIOC_s_INFO_FMT
1919 ": alt-%s reply irq re-enabled\n", 1926 "alt_ioc reply irq re-enabled\n", ioc->alt_ioc->name));
1920 ioc->alt_ioc->name));
1921 CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); 1927 CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM);
1922 ioc->alt_ioc->active = 1; 1928 ioc->alt_ioc->active = 1;
1923 } 1929 }
1924 1930
1925 } else { 1931 } else {
1926 printk(KERN_WARNING MYNAM ": %s NOT READY WARNING!\n", 1932 printk(MYIOC_s_WARN_FMT "NOT READY!\n", ioc->name);
1927 ioc->name);
1928 } 1933 }
1929 return -1; 1934 return -1;
1930 } 1935 }
@@ -1936,9 +1941,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1936 if ((rc = MakeIocReady(ioc->alt_ioc, 0, sleepFlag)) == 0) 1941 if ((rc = MakeIocReady(ioc->alt_ioc, 0, sleepFlag)) == 0)
1937 alt_ioc_ready = 1; 1942 alt_ioc_ready = 1;
1938 else 1943 else
1939 printk(KERN_WARNING MYNAM 1944 printk(MYIOC_s_WARN_FMT "alt_ioc not ready!\n", ioc->alt_ioc->name);
1940 ": alt-%s: Not ready WARNING!\n",
1941 ioc->alt_ioc->name);
1942 } 1945 }
1943 1946
1944 for (ii=0; ii<5; ii++) { 1947 for (ii=0; ii<5; ii++) {
@@ -1949,7 +1952,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1949 1952
1950 1953
1951 if (ii == 5) { 1954 if (ii == 5) {
1952 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Retry IocFacts failed rc=%x\n", ioc->name, rc)); 1955 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
1956 "Retry IocFacts failed rc=%x\n", ioc->name, rc));
1953 ret = -2; 1957 ret = -2;
1954 } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { 1958 } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
1955 MptDisplayIocCapabilities(ioc); 1959 MptDisplayIocCapabilities(ioc);
@@ -1958,14 +1962,14 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1958 if (alt_ioc_ready) { 1962 if (alt_ioc_ready) {
1959 if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) { 1963 if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) {
1960 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT 1964 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
1961 "Initial Alt IocFacts failed rc=%x\n", ioc->name, rc)); 1965 "Initial Alt IocFacts failed rc=%x\n", ioc->name, rc));
1962 /* Retry - alt IOC was initialized once 1966 /* Retry - alt IOC was initialized once
1963 */ 1967 */
1964 rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason); 1968 rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason);
1965 } 1969 }
1966 if (rc) { 1970 if (rc) {
1967 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT 1971 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
1968 "Retry Alt IocFacts failed rc=%x\n", ioc->name, rc)); 1972 "Retry Alt IocFacts failed rc=%x\n", ioc->name, rc));
1969 alt_ioc_ready = 0; 1973 alt_ioc_ready = 0;
1970 reset_alt_ioc_active = 0; 1974 reset_alt_ioc_active = 0;
1971 } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { 1975 } else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
@@ -1983,13 +1987,12 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1983 if (ioc->pcidev->irq) { 1987 if (ioc->pcidev->irq) {
1984 if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev)) 1988 if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev))
1985 printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", 1989 printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
1986 ioc->name); 1990 ioc->name);
1987 rc = request_irq(ioc->pcidev->irq, mpt_interrupt, 1991 rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
1988 IRQF_SHARED, ioc->name, ioc); 1992 IRQF_SHARED, ioc->name, ioc);
1989 if (rc < 0) { 1993 if (rc < 0) {
1990 printk(MYIOC_s_ERR_FMT "Unable to allocate " 1994 printk(MYIOC_s_ERR_FMT "Unable to allocate "
1991 "interrupt %d!\n", ioc->name, 1995 "interrupt %d!\n", ioc->name, ioc->pcidev->irq);
1992 ioc->pcidev->irq);
1993 if (mpt_msi_enable) 1996 if (mpt_msi_enable)
1994 pci_disable_msi(ioc->pcidev); 1997 pci_disable_msi(ioc->pcidev);
1995 return -EBUSY; 1998 return -EBUSY;
@@ -1998,8 +2001,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1998 ioc->pci_irq = ioc->pcidev->irq; 2001 ioc->pci_irq = ioc->pcidev->irq;
1999 pci_set_master(ioc->pcidev); /* ?? */ 2002 pci_set_master(ioc->pcidev); /* ?? */
2000 pci_set_drvdata(ioc->pcidev, ioc); 2003 pci_set_drvdata(ioc->pcidev, ioc);
2001 dprintk(ioc, printk(KERN_INFO MYNAM ": %s installed at interrupt " 2004 dprintk(ioc, printk(MYIOC_s_INFO_FMT "installed at interrupt "
2002 "%d\n", ioc->name, ioc->pcidev->irq)); 2005 "%d\n", ioc->name, ioc->pcidev->irq));
2003 } 2006 }
2004 } 2007 }
2005 2008
@@ -2018,8 +2021,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
2018 ret = -4; 2021 ret = -4;
2019// NEW! 2022// NEW!
2020 if (alt_ioc_ready && ((rc = PrimeIocFifos(ioc->alt_ioc)) != 0)) { 2023 if (alt_ioc_ready && ((rc = PrimeIocFifos(ioc->alt_ioc)) != 0)) {
2021 printk(KERN_WARNING MYNAM ": alt-%s: (%d) FIFO mgmt alloc WARNING!\n", 2024 printk(MYIOC_s_WARN_FMT ": alt_ioc (%d) FIFO mgmt alloc!\n",
2022 ioc->alt_ioc->name, rc); 2025 ioc->alt_ioc->name, rc);
2023 alt_ioc_ready = 0; 2026 alt_ioc_ready = 0;
2024 reset_alt_ioc_active = 0; 2027 reset_alt_ioc_active = 0;
2025 } 2028 }
@@ -2028,16 +2031,15 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
2028 if ((rc = SendIocInit(ioc->alt_ioc, sleepFlag)) != 0) { 2031 if ((rc = SendIocInit(ioc->alt_ioc, sleepFlag)) != 0) {
2029 alt_ioc_ready = 0; 2032 alt_ioc_ready = 0;
2030 reset_alt_ioc_active = 0; 2033 reset_alt_ioc_active = 0;
2031 printk(KERN_WARNING MYNAM 2034 printk(MYIOC_s_WARN_FMT "alt_ioc (%d) init failure!\n",
2032 ": alt-%s: (%d) init failure WARNING!\n", 2035 ioc->alt_ioc->name, rc);
2033 ioc->alt_ioc->name, rc);
2034 } 2036 }
2035 } 2037 }
2036 2038
2037 if (reason == MPT_HOSTEVENT_IOC_BRINGUP){ 2039 if (reason == MPT_HOSTEVENT_IOC_BRINGUP){
2038 if (ioc->upload_fw) { 2040 if (ioc->upload_fw) {
2039 ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2041 ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT
2040 "firmware upload required!\n", ioc->name)); 2042 "firmware upload required!\n", ioc->name));
2041 2043
2042 /* Controller is not operational, cannot do upload 2044 /* Controller is not operational, cannot do upload
2043 */ 2045 */
@@ -2053,12 +2055,13 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
2053 * mpt_diag_reset) 2055 * mpt_diag_reset)
2054 */ 2056 */
2055 ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2057 ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT
2056 ": mpt_upload: alt_%s has cached_fw=%p \n", 2058 "mpt_upload: alt_%s has cached_fw=%p \n",
2057 ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw)); 2059 ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw));
2058 ioc->alt_ioc->cached_fw = NULL; 2060 ioc->alt_ioc->cached_fw = NULL;
2059 } 2061 }
2060 } else { 2062 } else {
2061 printk(KERN_WARNING MYNAM ": firmware upload failure!\n"); 2063 printk(MYIOC_s_WARN_FMT
2064 "firmware upload failure!\n", ioc->name);
2062 ret = -5; 2065 ret = -5;
2063 } 2066 }
2064 } 2067 }
@@ -2073,8 +2076,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
2073 2076
2074 if (reset_alt_ioc_active && ioc->alt_ioc) { 2077 if (reset_alt_ioc_active && ioc->alt_ioc) {
2075 /* (re)Enable alt-IOC! (reply interrupt) */ 2078 /* (re)Enable alt-IOC! (reply interrupt) */
2076 dinitprintk(ioc, printk(KERN_INFO MYNAM ": alt-%s reply irq re-enabled\n", 2079 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "alt_ioc reply irq re-enabled\n",
2077 ioc->alt_ioc->name)); 2080 ioc->alt_ioc->name));
2078 CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); 2081 CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM);
2079 ioc->alt_ioc->active = 1; 2082 ioc->alt_ioc->active = 1;
2080 } 2083 }
@@ -2127,10 +2130,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
2127 (void) GetLanConfigPages(ioc); 2130 (void) GetLanConfigPages(ioc);
2128 a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; 2131 a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow;
2129 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2132 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
2130 "LanAddr = %02X:%02X:%02X:" 2133 "LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n",
2131 "%02X:%02X:%02X\n", 2134 ioc->name, a[5], a[4], a[3], a[2], a[1], a[0]));
2132 ioc->name, a[5], a[4],
2133 a[3], a[2], a[1], a[0] ));
2134 2135
2135 } 2136 }
2136 } else { 2137 } else {
@@ -2169,16 +2170,16 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
2169 for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) { 2170 for (cb_idx = MPT_MAX_PROTOCOL_DRIVERS-1; cb_idx; cb_idx--) {
2170 if ((ret == 0) && MptResetHandlers[cb_idx]) { 2171 if ((ret == 0) && MptResetHandlers[cb_idx]) {
2171 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2172 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
2172 "Calling IOC post_reset handler #%d\n", 2173 "Calling IOC post_reset handler #%d\n",
2173 ioc->name, cb_idx)); 2174 ioc->name, cb_idx));
2174 rc += mpt_signal_reset(cb_idx, ioc, MPT_IOC_POST_RESET); 2175 rc += mpt_signal_reset(cb_idx, ioc, MPT_IOC_POST_RESET);
2175 handlers++; 2176 handlers++;
2176 } 2177 }
2177 2178
2178 if (alt_ioc_ready && MptResetHandlers[cb_idx]) { 2179 if (alt_ioc_ready && MptResetHandlers[cb_idx]) {
2179 drsprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2180 drsprintk(ioc, printk(MYIOC_s_DEBUG_FMT
2180 "Calling alt-%s post_reset handler #%d\n", 2181 "Calling IOC post_reset handler #%d\n",
2181 ioc->name, ioc->alt_ioc->name, cb_idx)); 2182 ioc->alt_ioc->name, cb_idx));
2182 rc += mpt_signal_reset(cb_idx, ioc->alt_ioc, MPT_IOC_POST_RESET); 2183 rc += mpt_signal_reset(cb_idx, ioc->alt_ioc, MPT_IOC_POST_RESET);
2183 handlers++; 2184 handlers++;
2184 } 2185 }
@@ -2218,8 +2219,8 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)
2218 2219
2219 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PCI device %s devfn=%x/%x," 2220 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PCI device %s devfn=%x/%x,"
2220 " searching for devfn match on %x or %x\n", 2221 " searching for devfn match on %x or %x\n",
2221 ioc->name, pci_name(pdev), pdev->bus->number, 2222 ioc->name, pci_name(pdev), pdev->bus->number,
2222 pdev->devfn, func-1, func+1)); 2223 pdev->devfn, func-1, func+1));
2223 2224
2224 peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1)); 2225 peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1));
2225 if (!peer) { 2226 if (!peer) {
@@ -2233,15 +2234,15 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)
2233 if (_pcidev == peer) { 2234 if (_pcidev == peer) {
2234 /* Paranoia checks */ 2235 /* Paranoia checks */
2235 if (ioc->alt_ioc != NULL) { 2236 if (ioc->alt_ioc != NULL) {
2236 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n", 2237 printk(MYIOC_s_WARN_FMT "Oops, already bound to %s!\n",
2237 ioc->name, ioc->alt_ioc->name); 2238 ioc->name, ioc->alt_ioc->name);
2238 break; 2239 break;
2239 } else if (ioc_srch->alt_ioc != NULL) { 2240 } else if (ioc_srch->alt_ioc != NULL) {
2240 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n", 2241 printk(MYIOC_s_WARN_FMT "Oops, already bound to %s!\n",
2241 ioc_srch->name, ioc_srch->alt_ioc->name); 2242 ioc_srch->name, ioc_srch->alt_ioc->name);
2242 break; 2243 break;
2243 } 2244 }
2244 dprintk(ioc, printk(KERN_INFO MYNAM ": FOUND! binding %s <==> %s\n", 2245 dprintk(ioc, printk(MYIOC_s_INFO_FMT "FOUND! binding to %s\n",
2245 ioc->name, ioc_srch->name)); 2246 ioc->name, ioc_srch->name));
2246 ioc_srch->alt_ioc = ioc; 2247 ioc_srch->alt_ioc = ioc;
2247 ioc->alt_ioc = ioc_srch; 2248 ioc->alt_ioc = ioc_srch;
@@ -2262,10 +2263,11 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
2262 int ret; 2263 int ret;
2263 2264
2264 if (ioc->cached_fw != NULL) { 2265 if (ioc->cached_fw != NULL) {
2265 ddlprintk(ioc, printk(KERN_INFO MYNAM ": mpt_adapter_disable: Pushing FW onto adapter\n")); 2266 ddlprintk(ioc, printk(MYIOC_s_INFO_FMT
2267 "mpt_adapter_disable: Pushing FW onto adapter\n", ioc->name));
2266 if ((ret = mpt_downloadboot(ioc, (MpiFwHeader_t *)ioc->cached_fw, NO_SLEEP)) < 0) { 2268 if ((ret = mpt_downloadboot(ioc, (MpiFwHeader_t *)ioc->cached_fw, NO_SLEEP)) < 0) {
2267 printk(KERN_WARNING MYNAM 2269 printk(MYIOC_s_WARN_FMT "firmware downloadboot failure (%d)!\n",
2268 ": firmware downloadboot failure (%d)!\n", ret); 2270 ioc->name, ret);
2269 } 2271 }
2270 } 2272 }
2271 2273
@@ -2277,8 +2279,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
2277 2279
2278 if (ioc->alloc != NULL) { 2280 if (ioc->alloc != NULL) {
2279 sz = ioc->alloc_sz; 2281 sz = ioc->alloc_sz;
2280 dexitprintk(ioc, printk(KERN_INFO MYNAM ": %s.free @ %p, sz=%d bytes\n", 2282 dexitprintk(ioc, printk(MYIOC_s_INFO_FMT "free @ %p, sz=%d bytes\n",
2281 ioc->name, ioc->alloc, ioc->alloc_sz)); 2283 ioc->name, ioc->alloc, ioc->alloc_sz));
2282 pci_free_consistent(ioc->pcidev, sz, 2284 pci_free_consistent(ioc->pcidev, sz,
2283 ioc->alloc, ioc->alloc_dma); 2285 ioc->alloc, ioc->alloc_dma);
2284 ioc->reply_frames = NULL; 2286 ioc->reply_frames = NULL;
@@ -2338,15 +2340,14 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
2338 if (ioc->HostPageBuffer != NULL) { 2340 if (ioc->HostPageBuffer != NULL) {
2339 if((ret = mpt_host_page_access_control(ioc, 2341 if((ret = mpt_host_page_access_control(ioc,
2340 MPI_DB_HPBAC_FREE_BUFFER, NO_SLEEP)) != 0) { 2342 MPI_DB_HPBAC_FREE_BUFFER, NO_SLEEP)) != 0) {
2341 printk(KERN_ERR MYNAM 2343 printk(MYIOC_s_ERR_FMT
2342 ": %s: host page buffers free failed (%d)!\n", 2344 "host page buffers free failed (%d)!\n",
2343 __FUNCTION__, ret); 2345 ioc->name, ret);
2344 } 2346 }
2345 dexitprintk(ioc, printk(KERN_INFO MYNAM ": %s HostPageBuffer free @ %p, sz=%d bytes\n", 2347 dexitprintk(ioc, printk(MYIOC_s_INFO_FMT "HostPageBuffer free @ %p, sz=%d bytes\n",
2346 ioc->name, ioc->HostPageBuffer, ioc->HostPageBuffer_sz)); 2348 ioc->name, ioc->HostPageBuffer, ioc->HostPageBuffer_sz));
2347 pci_free_consistent(ioc->pcidev, ioc->HostPageBuffer_sz, 2349 pci_free_consistent(ioc->pcidev, ioc->HostPageBuffer_sz,
2348 ioc->HostPageBuffer, 2350 ioc->HostPageBuffer, ioc->HostPageBuffer_dma);
2349 ioc->HostPageBuffer_dma);
2350 ioc->HostPageBuffer = NULL; 2351 ioc->HostPageBuffer = NULL;
2351 ioc->HostPageBuffer_sz = 0; 2352 ioc->HostPageBuffer_sz = 0;
2352 ioc->alloc_total -= ioc->HostPageBuffer_sz; 2353 ioc->alloc_total -= ioc->HostPageBuffer_sz;
@@ -2388,7 +2389,7 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)
2388#if defined(CONFIG_MTRR) && 0 2389#if defined(CONFIG_MTRR) && 0
2389 if (ioc->mtrr_reg > 0) { 2390 if (ioc->mtrr_reg > 0) {
2390 mtrr_del(ioc->mtrr_reg, 0, 0); 2391 mtrr_del(ioc->mtrr_reg, 0, 0);
2391 dprintk(ioc, printk(KERN_INFO MYNAM ": %s: MTRR region de-registered\n", ioc->name)); 2392 dprintk(ioc, printk(MYIOC_s_INFO_FMT "MTRR region de-registered\n", ioc->name));
2392 } 2393 }
2393#endif 2394#endif
2394 2395
@@ -2396,8 +2397,8 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)
2396 list_del(&ioc->list); 2397 list_del(&ioc->list);
2397 2398
2398 sz_last = ioc->alloc_total; 2399 sz_last = ioc->alloc_total;
2399 dprintk(ioc, printk(KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n", 2400 dprintk(ioc, printk(MYIOC_s_INFO_FMT "free'd %d of %d bytes\n",
2400 ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first)); 2401 ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first));
2401 2402
2402 if (ioc->alt_ioc) 2403 if (ioc->alt_ioc)
2403 ioc->alt_ioc->alt_ioc = NULL; 2404 ioc->alt_ioc->alt_ioc = NULL;
@@ -2476,7 +2477,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
2476 2477
2477 /* Get current [raw] IOC state */ 2478 /* Get current [raw] IOC state */
2478 ioc_state = mpt_GetIocState(ioc, 0); 2479 ioc_state = mpt_GetIocState(ioc, 0);
2479 dhsprintk(ioc, printk(KERN_INFO MYNAM "::MakeIocReady, %s [raw] state=%08x\n", ioc->name, ioc_state)); 2480 dhsprintk(ioc, printk(MYIOC_s_INFO_FMT "MakeIocReady [raw] state=%08x\n", ioc->name, ioc_state));
2480 2481
2481 /* 2482 /*
2482 * Check to see if IOC got left/stuck in doorbell handshake 2483 * Check to see if IOC got left/stuck in doorbell handshake
@@ -2498,9 +2499,9 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
2498 if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) { 2499 if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) {
2499 statefault = 2; 2500 statefault = 2;
2500 printk(MYIOC_s_WARN_FMT "IOC is in FAULT state!!!\n", 2501 printk(MYIOC_s_WARN_FMT "IOC is in FAULT state!!!\n",
2501 ioc->name); 2502 ioc->name);
2502 printk(KERN_WARNING " FAULT code = %04xh\n", 2503 printk(MYIOC_s_WARN_FMT " FAULT code = %04xh\n",
2503 ioc_state & MPI_DOORBELL_DATA_MASK); 2504 ioc->name, ioc_state & MPI_DOORBELL_DATA_MASK);
2504 } 2505 }
2505 2506
2506 /* 2507 /*
@@ -2516,9 +2517,9 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
2516 * Else, fall through to KickStart case 2517 * Else, fall through to KickStart case
2517 */ 2518 */
2518 whoinit = (ioc_state & MPI_DOORBELL_WHO_INIT_MASK) >> MPI_DOORBELL_WHO_INIT_SHIFT; 2519 whoinit = (ioc_state & MPI_DOORBELL_WHO_INIT_MASK) >> MPI_DOORBELL_WHO_INIT_SHIFT;
2519 dinitprintk(ioc, printk(KERN_INFO MYNAM 2520 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT
2520 ": whoinit 0x%x statefault %d force %d\n", 2521 "whoinit 0x%x statefault %d force %d\n",
2521 whoinit, statefault, force)); 2522 ioc->name, whoinit, statefault, force));
2522 if (whoinit == MPI_WHOINIT_PCI_PEER) 2523 if (whoinit == MPI_WHOINIT_PCI_PEER)
2523 return -4; 2524 return -4;
2524 else { 2525 else {
@@ -2601,7 +2602,6 @@ mpt_GetIocState(MPT_ADAPTER *ioc, int cooked)
2601 2602
2602 /* Get! */ 2603 /* Get! */
2603 s = CHIPREG_READ32(&ioc->chip->Doorbell); 2604 s = CHIPREG_READ32(&ioc->chip->Doorbell);
2604// dprintk((MYIOC_s_INFO_FMT "raw state = %08x\n", ioc->name, s));
2605 sc = s & MPI_IOC_STATE_MASK; 2605 sc = s & MPI_IOC_STATE_MASK;
2606 2606
2607 /* Save! */ 2607 /* Save! */
@@ -2633,9 +2633,8 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
2633 2633
2634 /* IOC *must* NOT be in RESET state! */ 2634 /* IOC *must* NOT be in RESET state! */
2635 if (ioc->last_state == MPI_IOC_STATE_RESET) { 2635 if (ioc->last_state == MPI_IOC_STATE_RESET) {
2636 printk(KERN_ERR MYNAM ": ERROR - Can't get IOCFacts, %s NOT READY! (%08x)\n", 2636 printk(MYIOC_s_ERR_FMT "Can't get IOCFacts NOT READY! (%08x)\n",
2637 ioc->name, 2637 ioc->name, ioc->last_state );
2638 ioc->last_state );
2639 return -44; 2638 return -44;
2640 } 2639 }
2641 2640
@@ -2755,8 +2754,8 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
2755 } 2754 }
2756 ioc->NBShiftFactor = shiftFactor; 2755 ioc->NBShiftFactor = shiftFactor;
2757 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2756 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
2758 "NB_for_64_byte_frame=%x NBShiftFactor=%x BlockSize=%x\n", 2757 "NB_for_64_byte_frame=%x NBShiftFactor=%x BlockSize=%x\n",
2759 ioc->name, vv, shiftFactor, r)); 2758 ioc->name, vv, shiftFactor, r));
2760 2759
2761 if (reason == MPT_HOSTEVENT_IOC_BRINGUP) { 2760 if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
2762 /* 2761 /*
@@ -2809,9 +2808,8 @@ GetPortFacts(MPT_ADAPTER *ioc, int portnum, int sleepFlag)
2809 2808
2810 /* IOC *must* NOT be in RESET state! */ 2809 /* IOC *must* NOT be in RESET state! */
2811 if (ioc->last_state == MPI_IOC_STATE_RESET) { 2810 if (ioc->last_state == MPI_IOC_STATE_RESET) {
2812 printk(KERN_ERR MYNAM ": ERROR - Can't get PortFacts, %s NOT READY! (%08x)\n", 2811 printk(MYIOC_s_ERR_FMT "Can't get PortFacts NOT READY! (%08x)\n",
2813 ioc->name, 2812 ioc->name, ioc->last_state );
2814 ioc->last_state );
2815 return -4; 2813 return -4;
2816 } 2814 }
2817 2815
@@ -2986,7 +2984,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
2986 state = mpt_GetIocState(ioc, 1); 2984 state = mpt_GetIocState(ioc, 1);
2987 count++; 2985 count++;
2988 } 2986 }
2989 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "INFO - Wait IOC_OPERATIONAL state (cnt=%d)\n", 2987 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Wait IOC_OPERATIONAL state (cnt=%d)\n",
2990 ioc->name, count)); 2988 ioc->name, count));
2991 2989
2992 ioc->aen_event_read_flag=0; 2990 ioc->aen_event_read_flag=0;
@@ -3079,10 +3077,9 @@ mpt_free_fw_memory(MPT_ADAPTER *ioc)
3079 int sz; 3077 int sz;
3080 3078
3081 sz = ioc->facts.FWImageSize; 3079 sz = ioc->facts.FWImageSize;
3082 dinitprintk(ioc, printk(KERN_INFO MYNAM "free_fw_memory: FW Image @ %p[%p], sz=%d[%x] bytes\n", 3080 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "free_fw_memory: FW Image @ %p[%p], sz=%d[%x] bytes\n",
3083 ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); 3081 ioc->name, ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz));
3084 pci_free_consistent(ioc->pcidev, sz, 3082 pci_free_consistent(ioc->pcidev, sz, ioc->cached_fw, ioc->cached_fw_dma);
3085 ioc->cached_fw, ioc->cached_fw_dma);
3086 ioc->cached_fw = NULL; 3083 ioc->cached_fw = NULL;
3087 3084
3088 return; 3085 return;
@@ -3123,8 +3120,8 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
3123 3120
3124 mpt_alloc_fw_memory(ioc, sz); 3121 mpt_alloc_fw_memory(ioc, sz);
3125 3122
3126 dinitprintk(ioc, printk(KERN_INFO MYNAM ": FW Image @ %p[%p], sz=%d[%x] bytes\n", 3123 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": FW Image @ %p[%p], sz=%d[%x] bytes\n",
3127 ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz)); 3124 ioc->name, ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz));
3128 3125
3129 if (ioc->cached_fw == NULL) { 3126 if (ioc->cached_fw == NULL) {
3130 /* Major Failure. 3127 /* Major Failure.
@@ -3155,14 +3152,14 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
3155 mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma); 3152 mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma);
3156 3153
3157 sgeoffset += sizeof(u32) + sizeof(dma_addr_t); 3154 sgeoffset += sizeof(u32) + sizeof(dma_addr_t);
3158 dinitprintk(ioc, printk(KERN_INFO MYNAM ": Sending FW Upload (req @ %p) sgeoffset=%d \n", 3155 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": Sending FW Upload (req @ %p) sgeoffset=%d \n",
3159 prequest, sgeoffset)); 3156 ioc->name, prequest, sgeoffset));
3160 DBG_DUMP_FW_REQUEST_FRAME(ioc, (u32 *)prequest) 3157 DBG_DUMP_FW_REQUEST_FRAME(ioc, (u32 *)prequest);
3161 3158
3162 ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest, 3159 ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest,
3163 reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag); 3160 reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag);
3164 3161
3165 dinitprintk(ioc, printk(KERN_INFO MYNAM ": FW Upload completed rc=%x \n", ii)); 3162 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": FW Upload completed rc=%x \n", ioc->name, ii));
3166 3163
3167 cmdStatus = -EFAULT; 3164 cmdStatus = -EFAULT;
3168 if (ii == 0) { 3165 if (ii == 0) {
@@ -3433,7 +3430,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
3433 u32 ioc_state=0; 3430 u32 ioc_state=0;
3434 int cnt,cntdn; 3431 int cnt,cntdn;
3435 3432
3436 dinitprintk(ioc, printk(KERN_WARNING MYNAM ": KickStarting %s!\n", ioc->name)); 3433 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "KickStarting!\n", ioc->name));
3437 if (ioc->bus_type == SPI) { 3434 if (ioc->bus_type == SPI) {
3438 /* Always issue a Msg Unit Reset first. This will clear some 3435 /* Always issue a Msg Unit Reset first. This will clear some
3439 * SCSI bus hang conditions. 3436 * SCSI bus hang conditions.
@@ -3452,7 +3449,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
3452 return hard_reset_done; 3449 return hard_reset_done;
3453 3450
3454 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Diagnostic reset successful!\n", 3451 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Diagnostic reset successful!\n",
3455 ioc->name)); 3452 ioc->name));
3456 3453
3457 cntdn = ((sleepFlag == CAN_SLEEP) ? HZ : 1000) * 2; /* 2 seconds */ 3454 cntdn = ((sleepFlag == CAN_SLEEP) ? HZ : 1000) * 2; /* 2 seconds */
3458 for (cnt=0; cnt<cntdn; cnt++) { 3455 for (cnt=0; cnt<cntdn; cnt++) {
@@ -3469,8 +3466,8 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
3469 } 3466 }
3470 } 3467 }
3471 3468
3472 printk(MYIOC_s_ERR_FMT "Failed to come READY after reset! IocState=%x\n", 3469 dinitprintk(ioc, printk(MYIOC_s_ERR_FMT "Failed to come READY after reset! IocState=%x\n",
3473 ioc->name, ioc_state); 3470 ioc->name, mpt_GetIocState(ioc, 0)));
3474 return -1; 3471 return -1;
3475} 3472}
3476 3473
@@ -3658,8 +3655,8 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3658 } 3655 }
3659 if ((count = mpt_downloadboot(ioc, 3656 if ((count = mpt_downloadboot(ioc,
3660 (MpiFwHeader_t *)iocp->cached_fw, sleepFlag)) < 0) { 3657 (MpiFwHeader_t *)iocp->cached_fw, sleepFlag)) < 0) {
3661 printk(KERN_WARNING MYNAM 3658 printk(MYIOC_s_WARN_FMT
3662 ": firmware downloadboot failure (%d)!\n", count); 3659 "firmware downloadboot failure (%d)!\n", ioc->name, count);
3663 } 3660 }
3664 3661
3665 } else { 3662 } else {
@@ -3802,8 +3799,8 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag)
3802 if (sleepFlag != CAN_SLEEP) 3799 if (sleepFlag != CAN_SLEEP)
3803 count *= 10; 3800 count *= 10;
3804 3801
3805 printk(KERN_ERR MYNAM ": %s: ERROR - Wait IOC_READY state timeout(%d)!\n", 3802 printk(MYIOC_s_ERR_FMT "Wait IOC_READY state timeout(%d)!\n",
3806 ioc->name, (int)((count+5)/HZ)); 3803 ioc->name, (int)((count+5)/HZ));
3807 return -ETIME; 3804 return -ETIME;
3808 } 3805 }
3809 3806
@@ -4196,7 +4193,7 @@ mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req,
4196 } 4193 }
4197 4194
4198 dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handshake request frame (@%p) header\n", ioc->name, req)); 4195 dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handshake request frame (@%p) header\n", ioc->name, req));
4199 DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)req) 4196 DBG_DUMP_REQUEST_FRAME_HDR(ioc, (u32 *)req);
4200 4197
4201 dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "HandShake request post done, WaitCnt=%d%s\n", 4198 dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "HandShake request post done, WaitCnt=%d%s\n",
4202 ioc->name, t, failcnt ? " - MISSING DOORBELL ACK!" : "")); 4199 ioc->name, t, failcnt ? " - MISSING DOORBELL ACK!" : ""));
@@ -4401,7 +4398,7 @@ WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
4401#endif 4398#endif
4402 4399
4403 dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got Handshake reply:\n", ioc->name)); 4400 dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Got Handshake reply:\n", ioc->name));
4404 DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mptReply) 4401 DBG_DUMP_REPLY_FRAME(ioc, (u32 *)mptReply);
4405 4402
4406 dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "WaitForDoorbell REPLY WaitCnt=%d (sz=%d)\n", 4403 dhsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "WaitForDoorbell REPLY WaitCnt=%d (sz=%d)\n",
4407 ioc->name, t, u16cnt/2)); 4404 ioc->name, t, u16cnt/2));
@@ -4876,8 +4873,8 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
4876 4873
4877 if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) { 4874 if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) {
4878 ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS; 4875 ioc->spi_data.noQas |= MPT_TARGET_NO_NEGO_QAS;
4879 ddvprintk(ioc, printk(KERN_INFO MYNAM 4876 ddvprintk(ioc, printk(MYIOC_s_DEBUG_FMT
4880 " :%s noQas due to Capabilities=%x\n", 4877 "noQas due to Capabilities=%x\n",
4881 ioc->name, pPP0->Capabilities)); 4878 ioc->name, pPP0->Capabilities));
4882 } 4879 }
4883 ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0; 4880 ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0;
@@ -5785,10 +5782,10 @@ mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
5785 CONFIGPARMS *pCfg; 5782 CONFIGPARMS *pCfg;
5786 unsigned long flags; 5783 unsigned long flags;
5787 5784
5788 dprintk(ioc, printk(KERN_DEBUG MYNAM 5785 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
5789 ": IOC %s_reset routed to MPT base driver!\n", 5786 ": IOC %s_reset routed to MPT base driver!\n",
5790 reset_phase==MPT_IOC_SETUP_RESET ? "setup" : ( 5787 ioc->name, reset_phase==MPT_IOC_SETUP_RESET ? "setup" : (
5791 reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post"))); 5788 reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")));
5792 5789
5793 if (reset_phase == MPT_IOC_SETUP_RESET) { 5790 if (reset_phase == MPT_IOC_SETUP_RESET) {
5794 ; 5791 ;
@@ -6201,8 +6198,7 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
6201 } 6198 }
6202 6199
6203 if ((rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag)) != 0) { 6200 if ((rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag)) != 0) {
6204 printk(KERN_WARNING MYNAM ": WARNING - (%d) Cannot recover %s\n", 6201 printk(MYIOC_s_WARN_FMT "Cannot recover rc = %d!\n", ioc->name, rc);
6205 rc, ioc->name);
6206 } 6202 }
6207 ioc->reload_fw = 0; 6203 ioc->reload_fw = 0;
6208 if (ioc->alt_ioc) 6204 if (ioc->alt_ioc)
@@ -6622,12 +6618,12 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
6622 evStr)); 6618 evStr));
6623 6619
6624#ifdef CONFIG_FUSION_LOGGING 6620#ifdef CONFIG_FUSION_LOGGING
6625 devtverboseprintk(ioc, printk(KERN_DEBUG MYNAM 6621 devtverboseprintk(ioc, printk(MYIOC_s_DEBUG_FMT
6626 ": Event data:\n")); 6622 ": Event data:\n", ioc->name));
6627 for (ii = 0; ii < evDataLen; ii++) 6623 for (ii = 0; ii < evDataLen; ii++)
6628 devtverboseprintk(ioc, printk(" %08x", 6624 devtverboseprintk(ioc, printk(" %08x",
6629 le32_to_cpu(pEventReply->Data[ii]))); 6625 le32_to_cpu(pEventReply->Data[ii])));
6630 devtverboseprintk(ioc, printk(KERN_DEBUG "\n")); 6626 devtverboseprintk(ioc, printk("\n"));
6631#endif 6627#endif
6632 6628
6633 /* 6629 /*
@@ -7119,8 +7115,8 @@ mpt_iocstatus_info_config(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
7119 if (!desc) 7115 if (!desc)
7120 return; 7116 return;
7121 7117
7122 printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04X): %s: %s\n", 7118 dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT "IOCStatus(0x%04X): %s: %s\n",
7123 ioc->name, ioc_status, desc, extend_desc); 7119 ioc->name, ioc_status, desc, extend_desc));
7124} 7120}
7125 7121
7126/** 7122/**
@@ -7346,7 +7342,8 @@ mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
7346 if (!desc) 7342 if (!desc)
7347 return; 7343 return;
7348 7344
7349 printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04X): %s\n", ioc->name, status, desc); 7345 dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT "IOCStatus(0x%04X): %s\n",
7346 ioc->name, status, desc));
7350} 7347}
7351 7348
7352/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 7349/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index 12dfa2e84f0f..5d137a8b3096 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -181,7 +181,6 @@ static inline int
181mptctl_syscall_down(MPT_ADAPTER *ioc, int nonblock) 181mptctl_syscall_down(MPT_ADAPTER *ioc, int nonblock)
182{ 182{
183 int rc = 0; 183 int rc = 0;
184// dctlprintk(ioc, printk(KERN_DEBUG MYNAM "::mptctl_syscall_down(%p,%d) called\n", ioc, nonblock));
185 184
186 if (nonblock) { 185 if (nonblock) {
187 if (!mutex_trylock(&ioc->ioctl->ioctl_mutex)) 186 if (!mutex_trylock(&ioc->ioctl->ioctl_mutex))
@@ -190,7 +189,6 @@ mptctl_syscall_down(MPT_ADAPTER *ioc, int nonblock)
190 if (mutex_lock_interruptible(&ioc->ioctl->ioctl_mutex)) 189 if (mutex_lock_interruptible(&ioc->ioctl->ioctl_mutex))
191 rc = -ERESTARTSYS; 190 rc = -ERESTARTSYS;
192 } 191 }
193// dctlprintk(ioc, printk(KERN_DEBUG MYNAM "::mptctl_syscall_down return %d\n", rc));
194 return rc; 192 return rc;
195} 193}
196 194
@@ -475,7 +473,7 @@ static int
475mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) 473mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
476{ 474{
477 MPT_IOCTL *ioctl = ioc->ioctl; 475 MPT_IOCTL *ioctl = ioc->ioctl;
478 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": IOC %s_reset routed to IOCTL driver!\n",ioc->name, 476 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "IOC %s_reset routed to IOCTL driver!\n", ioc->name,
479 reset_phase==MPT_IOC_SETUP_RESET ? "setup" : ( 477 reset_phase==MPT_IOC_SETUP_RESET ? "setup" : (
480 reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post"))); 478 reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")));
481 479
@@ -581,7 +579,7 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
581 MPT_ADAPTER *iocp = NULL; 579 MPT_ADAPTER *iocp = NULL;
582 580
583 if (copy_from_user(&khdr, uhdr, sizeof(khdr))) { 581 if (copy_from_user(&khdr, uhdr, sizeof(khdr))) {
584 printk(KERN_ERR "%s::mptctl_ioctl() @%d - " 582 printk(KERN_ERR MYNAM "%s::mptctl_ioctl() @%d - "
585 "Unable to copy mpt_ioctl_header data @ %p\n", 583 "Unable to copy mpt_ioctl_header data @ %p\n",
586 __FILE__, __LINE__, uhdr); 584 __FILE__, __LINE__, uhdr);
587 return -EFAULT; 585 return -EFAULT;
@@ -594,13 +592,13 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
594 iocnumX = khdr.iocnum & 0xFF; 592 iocnumX = khdr.iocnum & 0xFF;
595 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || 593 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
596 (iocp == NULL)) { 594 (iocp == NULL)) {
597 printk(KERN_DEBUG "%s::mptctl_ioctl() @%d - ioc%d not found!\n", 595 printk(KERN_DEBUG MYNAM "%s::mptctl_ioctl() @%d - ioc%d not found!\n",
598 __FILE__, __LINE__, iocnumX); 596 __FILE__, __LINE__, iocnumX);
599 return -ENODEV; 597 return -ENODEV;
600 } 598 }
601 599
602 if (!iocp->active) { 600 if (!iocp->active) {
603 printk(KERN_DEBUG "%s::mptctl_ioctl() @%d - Controller disabled.\n", 601 printk(KERN_DEBUG MYNAM "%s::mptctl_ioctl() @%d - Controller disabled.\n",
604 __FILE__, __LINE__); 602 __FILE__, __LINE__);
605 return -EFAULT; 603 return -EFAULT;
606 } 604 }
@@ -667,14 +665,14 @@ static int mptctl_do_reset(unsigned long arg)
667 MPT_ADAPTER *iocp; 665 MPT_ADAPTER *iocp;
668 666
669 if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) { 667 if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) {
670 printk(KERN_ERR "%s@%d::mptctl_do_reset - " 668 printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - "
671 "Unable to copy mpt_ioctl_diag_reset struct @ %p\n", 669 "Unable to copy mpt_ioctl_diag_reset struct @ %p\n",
672 __FILE__, __LINE__, urinfo); 670 __FILE__, __LINE__, urinfo);
673 return -EFAULT; 671 return -EFAULT;
674 } 672 }
675 673
676 if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) { 674 if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) {
677 printk(KERN_DEBUG "%s@%d::mptctl_do_reset - ioc%d not found!\n", 675 printk(KERN_DEBUG MYNAM "%s@%d::mptctl_do_reset - ioc%d not found!\n",
678 __FILE__, __LINE__, krinfo.hdr.iocnum); 676 __FILE__, __LINE__, krinfo.hdr.iocnum);
679 return -ENODEV; /* (-6) No such device or address */ 677 return -ENODEV; /* (-6) No such device or address */
680 } 678 }
@@ -683,8 +681,8 @@ static int mptctl_do_reset(unsigned long arg)
683 iocp->name)); 681 iocp->name));
684 682
685 if (mpt_HardResetHandler(iocp, CAN_SLEEP) != 0) { 683 if (mpt_HardResetHandler(iocp, CAN_SLEEP) != 0) {
686 printk (KERN_ERR "%s@%d::mptctl_do_reset - reset failed.\n", 684 printk (MYIOC_s_ERR_FMT "%s@%d::mptctl_do_reset - reset failed.\n",
687 __FILE__, __LINE__); 685 iocp->name, __FILE__, __LINE__);
688 return -1; 686 return -1;
689 } 687 }
690 688
@@ -715,7 +713,7 @@ mptctl_fw_download(unsigned long arg)
715 struct mpt_fw_xfer kfwdl; 713 struct mpt_fw_xfer kfwdl;
716 714
717 if (copy_from_user(&kfwdl, ufwdl, sizeof(struct mpt_fw_xfer))) { 715 if (copy_from_user(&kfwdl, ufwdl, sizeof(struct mpt_fw_xfer))) {
718 printk(KERN_ERR "%s@%d::_ioctl_fwdl - " 716 printk(KERN_ERR MYNAM "%s@%d::_ioctl_fwdl - "
719 "Unable to copy mpt_fw_xfer struct @ %p\n", 717 "Unable to copy mpt_fw_xfer struct @ %p\n",
720 __FILE__, __LINE__, ufwdl); 718 __FILE__, __LINE__, ufwdl);
721 return -EFAULT; 719 return -EFAULT;
@@ -763,7 +761,8 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
763 pFWDownloadReply_t ReplyMsg = NULL; 761 pFWDownloadReply_t ReplyMsg = NULL;
764 762
765 if (mpt_verify_adapter(ioc, &iocp) < 0) { 763 if (mpt_verify_adapter(ioc, &iocp) < 0) {
766 printk(KERN_DEBUG "ioctl_fwdl - ioc%d not found!\n", ioc); 764 printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n",
765 ioc);
767 return -ENODEV; /* (-6) No such device or address */ 766 return -ENODEV; /* (-6) No such device or address */
768 } else { 767 } else {
769 768
@@ -875,9 +874,9 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
875 mpt_add_sge(sgOut, sgIn->FlagsLength, sgIn->Address); 874 mpt_add_sge(sgOut, sgIn->FlagsLength, sgIn->Address);
876 n++; 875 n++;
877 if (copy_from_user(bl->kptr, ufwbuf+fw_bytes_copied, bl->len)) { 876 if (copy_from_user(bl->kptr, ufwbuf+fw_bytes_copied, bl->len)) {
878 printk(KERN_ERR "%s@%d::_ioctl_fwdl - " 877 printk(MYIOC_s_ERR_FMT "%s@%d::_ioctl_fwdl - "
879 "Unable to copy f/w buffer hunk#%d @ %p\n", 878 "Unable to copy f/w buffer hunk#%d @ %p\n",
880 __FILE__, __LINE__, n, ufwbuf); 879 iocp->name, __FILE__, __LINE__, n, ufwbuf);
881 goto fwdl_out; 880 goto fwdl_out;
882 } 881 }
883 fw_bytes_copied += bl->len; 882 fw_bytes_copied += bl->len;
@@ -913,21 +912,22 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
913 ReplyMsg = (pFWDownloadReply_t)iocp->ioctl->ReplyFrame; 912 ReplyMsg = (pFWDownloadReply_t)iocp->ioctl->ReplyFrame;
914 iocstat = le16_to_cpu(ReplyMsg->IOCStatus) & MPI_IOCSTATUS_MASK; 913 iocstat = le16_to_cpu(ReplyMsg->IOCStatus) & MPI_IOCSTATUS_MASK;
915 if (iocstat == MPI_IOCSTATUS_SUCCESS) { 914 if (iocstat == MPI_IOCSTATUS_SUCCESS) {
916 printk(KERN_INFO MYNAM ": F/W update successfully sent to %s!\n", iocp->name); 915 printk(MYIOC_s_INFO_FMT "F/W update successfull!\n", iocp->name);
917 return 0; 916 return 0;
918 } else if (iocstat == MPI_IOCSTATUS_INVALID_FUNCTION) { 917 } else if (iocstat == MPI_IOCSTATUS_INVALID_FUNCTION) {
919 printk(KERN_WARNING MYNAM ": ?Hmmm... %s says it doesn't support F/W download!?!\n", 918 printk(MYIOC_s_WARN_FMT "Hmmm... F/W download not supported!?!\n",
920 iocp->name); 919 iocp->name);
921 printk(KERN_WARNING MYNAM ": (time to go bang on somebodies door)\n"); 920 printk(MYIOC_s_WARN_FMT "(time to go bang on somebodies door)\n",
921 iocp->name);
922 return -EBADRQC; 922 return -EBADRQC;
923 } else if (iocstat == MPI_IOCSTATUS_BUSY) { 923 } else if (iocstat == MPI_IOCSTATUS_BUSY) {
924 printk(KERN_WARNING MYNAM ": Warning! %s says: IOC_BUSY!\n", iocp->name); 924 printk(MYIOC_s_WARN_FMT "IOC_BUSY!\n", iocp->name);
925 printk(KERN_WARNING MYNAM ": (try again later?)\n"); 925 printk(MYIOC_s_WARN_FMT "(try again later?)\n", iocp->name);
926 return -EBUSY; 926 return -EBUSY;
927 } else { 927 } else {
928 printk(KERN_WARNING MYNAM "::ioctl_fwdl() ERROR! %s returned [bad] status = %04xh\n", 928 printk(MYIOC_s_WARN_FMT "ioctl_fwdl() returned [bad] status = %04xh\n",
929 iocp->name, iocstat); 929 iocp->name, iocstat);
930 printk(KERN_WARNING MYNAM ": (bad VooDoo)\n"); 930 printk(MYIOC_s_WARN_FMT "(bad VooDoo)\n", iocp->name);
931 return -ENOMSG; 931 return -ENOMSG;
932 } 932 }
933 return 0; 933 return 0;
@@ -1014,10 +1014,10 @@ kbuf_alloc_2_sgl(int bytes, u32 sgdir, int sge_offset, int *frags,
1014 if (buflist[buflist_ent].kptr == NULL) { 1014 if (buflist[buflist_ent].kptr == NULL) {
1015 alloc_sz = alloc_sz / 2; 1015 alloc_sz = alloc_sz / 2;
1016 if (alloc_sz == 0) { 1016 if (alloc_sz == 0) {
1017 printk(KERN_WARNING MYNAM "-SG: No can do - " 1017 printk(MYIOC_s_WARN_FMT "-SG: No can do - "
1018 "not enough memory! :-(\n"); 1018 "not enough memory! :-(\n", ioc->name);
1019 printk(KERN_WARNING MYNAM "-SG: (freeing %d frags)\n", 1019 printk(MYIOC_s_WARN_FMT "-SG: (freeing %d frags)\n",
1020 numfrags); 1020 ioc->name, numfrags);
1021 goto free_and_fail; 1021 goto free_and_fail;
1022 } 1022 }
1023 continue; 1023 continue;
@@ -1040,18 +1040,19 @@ kbuf_alloc_2_sgl(int bytes, u32 sgdir, int sge_offset, int *frags,
1040 1040
1041 /* Need to chain? */ 1041 /* Need to chain? */
1042 if (fragcnt == sg_spill) { 1042 if (fragcnt == sg_spill) {
1043 printk(KERN_WARNING MYNAM "-SG: No can do - " "Chain required! :-(\n"); 1043 printk(MYIOC_s_WARN_FMT
1044 printk(KERN_WARNING MYNAM "(freeing %d frags)\n", numfrags); 1044 "-SG: No can do - " "Chain required! :-(\n", ioc->name);
1045 printk(MYIOC_s_WARN_FMT "(freeing %d frags)\n", ioc->name, numfrags);
1045 goto free_and_fail; 1046 goto free_and_fail;
1046 } 1047 }
1047 1048
1048 /* overflow check... */ 1049 /* overflow check... */
1049 if (numfrags*8 > MAX_SGL_BYTES){ 1050 if (numfrags*8 > MAX_SGL_BYTES){
1050 /* GRRRRR... */ 1051 /* GRRRRR... */
1051 printk(KERN_WARNING MYNAM "-SG: No can do - " 1052 printk(MYIOC_s_WARN_FMT "-SG: No can do - "
1052 "too many SG frags! :-(\n"); 1053 "too many SG frags! :-(\n", ioc->name);
1053 printk(KERN_WARNING MYNAM "-SG: (freeing %d frags)\n", 1054 printk(MYIOC_s_WARN_FMT "-SG: (freeing %d frags)\n",
1054 numfrags); 1055 ioc->name, numfrags);
1055 goto free_and_fail; 1056 goto free_and_fail;
1056 } 1057 }
1057 } 1058 }
@@ -1072,8 +1073,6 @@ kbuf_alloc_2_sgl(int bytes, u32 sgdir, int sge_offset, int *frags,
1072 1073
1073free_and_fail: 1074free_and_fail:
1074 if (sglbuf != NULL) { 1075 if (sglbuf != NULL) {
1075 int i;
1076
1077 for (i = 0; i < numfrags; i++) { 1076 for (i = 0; i < numfrags; i++) {
1078 dma_addr_t dma_addr; 1077 dma_addr_t dma_addr;
1079 u8 *kptr; 1078 u8 *kptr;
@@ -1195,13 +1194,13 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1195 1194
1196 karg = kmalloc(data_size, GFP_KERNEL); 1195 karg = kmalloc(data_size, GFP_KERNEL);
1197 if (karg == NULL) { 1196 if (karg == NULL) {
1198 printk(KERN_ERR "%s::mpt_ioctl_iocinfo() @%d - no memory available!\n", 1197 printk(KERN_ERR MYNAM "%s::mpt_ioctl_iocinfo() @%d - no memory available!\n",
1199 __FILE__, __LINE__); 1198 __FILE__, __LINE__);
1200 return -ENOMEM; 1199 return -ENOMEM;
1201 } 1200 }
1202 1201
1203 if (copy_from_user(karg, uarg, data_size)) { 1202 if (copy_from_user(karg, uarg, data_size)) {
1204 printk(KERN_ERR "%s@%d::mptctl_getiocinfo - " 1203 printk(KERN_ERR MYNAM "%s@%d::mptctl_getiocinfo - "
1205 "Unable to read in mpt_ioctl_iocinfo struct @ %p\n", 1204 "Unable to read in mpt_ioctl_iocinfo struct @ %p\n",
1206 __FILE__, __LINE__, uarg); 1205 __FILE__, __LINE__, uarg);
1207 kfree(karg); 1206 kfree(karg);
@@ -1210,7 +1209,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1210 1209
1211 if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) || 1210 if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) ||
1212 (ioc == NULL)) { 1211 (ioc == NULL)) {
1213 printk(KERN_DEBUG "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n", 1212 printk(KERN_DEBUG MYNAM "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n",
1214 __FILE__, __LINE__, iocnum); 1213 __FILE__, __LINE__, iocnum);
1215 kfree(karg); 1214 kfree(karg);
1216 return -ENODEV; 1215 return -ENODEV;
@@ -1218,9 +1217,9 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1218 1217
1219 /* Verify the data transfer size is correct. */ 1218 /* Verify the data transfer size is correct. */
1220 if (karg->hdr.maxDataSize != data_size) { 1219 if (karg->hdr.maxDataSize != data_size) {
1221 printk(KERN_ERR "%s@%d::mptctl_getiocinfo - " 1220 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - "
1222 "Structure size mismatch. Command not completed.\n", 1221 "Structure size mismatch. Command not completed.\n",
1223 __FILE__, __LINE__); 1222 ioc->name, __FILE__, __LINE__);
1224 kfree(karg); 1223 kfree(karg);
1225 return -EFAULT; 1224 return -EFAULT;
1226 } 1225 }
@@ -1296,9 +1295,9 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1296 /* Copy the data from kernel memory to user memory 1295 /* Copy the data from kernel memory to user memory
1297 */ 1296 */
1298 if (copy_to_user((char __user *)arg, karg, data_size)) { 1297 if (copy_to_user((char __user *)arg, karg, data_size)) {
1299 printk(KERN_ERR "%s@%d::mptctl_getiocinfo - " 1298 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - "
1300 "Unable to write out mpt_ioctl_iocinfo struct @ %p\n", 1299 "Unable to write out mpt_ioctl_iocinfo struct @ %p\n",
1301 __FILE__, __LINE__, uarg); 1300 ioc->name, __FILE__, __LINE__, uarg);
1302 kfree(karg); 1301 kfree(karg);
1303 return -EFAULT; 1302 return -EFAULT;
1304 } 1303 }
@@ -1335,7 +1334,7 @@ mptctl_gettargetinfo (unsigned long arg)
1335 struct scsi_device *sdev; 1334 struct scsi_device *sdev;
1336 1335
1337 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) { 1336 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) {
1338 printk(KERN_ERR "%s@%d::mptctl_gettargetinfo - " 1337 printk(KERN_ERR MYNAM "%s@%d::mptctl_gettargetinfo - "
1339 "Unable to read in mpt_ioctl_targetinfo struct @ %p\n", 1338 "Unable to read in mpt_ioctl_targetinfo struct @ %p\n",
1340 __FILE__, __LINE__, uarg); 1339 __FILE__, __LINE__, uarg);
1341 return -EFAULT; 1340 return -EFAULT;
@@ -1343,7 +1342,7 @@ mptctl_gettargetinfo (unsigned long arg)
1343 1342
1344 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1343 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1345 (ioc == NULL)) { 1344 (ioc == NULL)) {
1346 printk(KERN_DEBUG "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n", 1345 printk(KERN_DEBUG MYNAM "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n",
1347 __FILE__, __LINE__, iocnum); 1346 __FILE__, __LINE__, iocnum);
1348 return -ENODEV; 1347 return -ENODEV;
1349 } 1348 }
@@ -1359,8 +1358,8 @@ mptctl_gettargetinfo (unsigned long arg)
1359 port = karg.hdr.port; 1358 port = karg.hdr.port;
1360 1359
1361 if (maxWordsLeft <= 0) { 1360 if (maxWordsLeft <= 0) {
1362 printk(KERN_ERR "%s::mptctl_gettargetinfo() @%d - no memory available!\n", 1361 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo() - no memory available!\n",
1363 __FILE__, __LINE__); 1362 ioc->name, __FILE__, __LINE__);
1364 return -ENOMEM; 1363 return -ENOMEM;
1365 } 1364 }
1366 1365
@@ -1380,8 +1379,8 @@ mptctl_gettargetinfo (unsigned long arg)
1380 */ 1379 */
1381 pmem = kzalloc(numBytes, GFP_KERNEL); 1380 pmem = kzalloc(numBytes, GFP_KERNEL);
1382 if (!pmem) { 1381 if (!pmem) {
1383 printk(KERN_ERR "%s::mptctl_gettargetinfo() @%d - no memory available!\n", 1382 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo() - no memory available!\n",
1384 __FILE__, __LINE__); 1383 ioc->name, __FILE__, __LINE__);
1385 return -ENOMEM; 1384 return -ENOMEM;
1386 } 1385 }
1387 pdata = (int *) pmem; 1386 pdata = (int *) pmem;
@@ -1410,9 +1409,9 @@ mptctl_gettargetinfo (unsigned long arg)
1410 */ 1409 */
1411 if (copy_to_user((char __user *)arg, &karg, 1410 if (copy_to_user((char __user *)arg, &karg,
1412 sizeof(struct mpt_ioctl_targetinfo))) { 1411 sizeof(struct mpt_ioctl_targetinfo))) {
1413 printk(KERN_ERR "%s@%d::mptctl_gettargetinfo - " 1412 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo - "
1414 "Unable to write out mpt_ioctl_targetinfo struct @ %p\n", 1413 "Unable to write out mpt_ioctl_targetinfo struct @ %p\n",
1415 __FILE__, __LINE__, uarg); 1414 ioc->name, __FILE__, __LINE__, uarg);
1416 kfree(pmem); 1415 kfree(pmem);
1417 return -EFAULT; 1416 return -EFAULT;
1418 } 1417 }
@@ -1420,9 +1419,9 @@ mptctl_gettargetinfo (unsigned long arg)
1420 /* Copy the remaining data from kernel memory to user memory 1419 /* Copy the remaining data from kernel memory to user memory
1421 */ 1420 */
1422 if (copy_to_user(uarg->targetInfo, pmem, numBytes)) { 1421 if (copy_to_user(uarg->targetInfo, pmem, numBytes)) {
1423 printk(KERN_ERR "%s@%d::mptctl_gettargetinfo - " 1422 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo - "
1424 "Unable to write out mpt_ioctl_targetinfo struct @ %p\n", 1423 "Unable to write out mpt_ioctl_targetinfo struct @ %p\n",
1425 __FILE__, __LINE__, pdata); 1424 ioc->name, __FILE__, __LINE__, pdata);
1426 kfree(pmem); 1425 kfree(pmem);
1427 return -EFAULT; 1426 return -EFAULT;
1428 } 1427 }
@@ -1449,7 +1448,7 @@ mptctl_readtest (unsigned long arg)
1449 int iocnum; 1448 int iocnum;
1450 1449
1451 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { 1450 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) {
1452 printk(KERN_ERR "%s@%d::mptctl_readtest - " 1451 printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - "
1453 "Unable to read in mpt_ioctl_test struct @ %p\n", 1452 "Unable to read in mpt_ioctl_test struct @ %p\n",
1454 __FILE__, __LINE__, uarg); 1453 __FILE__, __LINE__, uarg);
1455 return -EFAULT; 1454 return -EFAULT;
@@ -1457,7 +1456,7 @@ mptctl_readtest (unsigned long arg)
1457 1456
1458 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1457 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1459 (ioc == NULL)) { 1458 (ioc == NULL)) {
1460 printk(KERN_DEBUG "%s::mptctl_readtest() @%d - ioc%d not found!\n", 1459 printk(KERN_DEBUG MYNAM "%s::mptctl_readtest() @%d - ioc%d not found!\n",
1461 __FILE__, __LINE__, iocnum); 1460 __FILE__, __LINE__, iocnum);
1462 return -ENODEV; 1461 return -ENODEV;
1463 } 1462 }
@@ -1481,9 +1480,9 @@ mptctl_readtest (unsigned long arg)
1481 /* Copy the data from kernel memory to user memory 1480 /* Copy the data from kernel memory to user memory
1482 */ 1481 */
1483 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_test))) { 1482 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_test))) {
1484 printk(KERN_ERR "%s@%d::mptctl_readtest - " 1483 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_readtest - "
1485 "Unable to write out mpt_ioctl_test struct @ %p\n", 1484 "Unable to write out mpt_ioctl_test struct @ %p\n",
1486 __FILE__, __LINE__, uarg); 1485 ioc->name, __FILE__, __LINE__, uarg);
1487 return -EFAULT; 1486 return -EFAULT;
1488 } 1487 }
1489 1488
@@ -1510,7 +1509,7 @@ mptctl_eventquery (unsigned long arg)
1510 int iocnum; 1509 int iocnum;
1511 1510
1512 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { 1511 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) {
1513 printk(KERN_ERR "%s@%d::mptctl_eventquery - " 1512 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - "
1514 "Unable to read in mpt_ioctl_eventquery struct @ %p\n", 1513 "Unable to read in mpt_ioctl_eventquery struct @ %p\n",
1515 __FILE__, __LINE__, uarg); 1514 __FILE__, __LINE__, uarg);
1516 return -EFAULT; 1515 return -EFAULT;
@@ -1518,7 +1517,7 @@ mptctl_eventquery (unsigned long arg)
1518 1517
1519 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1518 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1520 (ioc == NULL)) { 1519 (ioc == NULL)) {
1521 printk(KERN_DEBUG "%s::mptctl_eventquery() @%d - ioc%d not found!\n", 1520 printk(KERN_DEBUG MYNAM "%s::mptctl_eventquery() @%d - ioc%d not found!\n",
1522 __FILE__, __LINE__, iocnum); 1521 __FILE__, __LINE__, iocnum);
1523 return -ENODEV; 1522 return -ENODEV;
1524 } 1523 }
@@ -1531,9 +1530,9 @@ mptctl_eventquery (unsigned long arg)
1531 /* Copy the data from kernel memory to user memory 1530 /* Copy the data from kernel memory to user memory
1532 */ 1531 */
1533 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_eventquery))) { 1532 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_eventquery))) {
1534 printk(KERN_ERR "%s@%d::mptctl_eventquery - " 1533 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_eventquery - "
1535 "Unable to write out mpt_ioctl_eventquery struct @ %p\n", 1534 "Unable to write out mpt_ioctl_eventquery struct @ %p\n",
1536 __FILE__, __LINE__, uarg); 1535 ioc->name, __FILE__, __LINE__, uarg);
1537 return -EFAULT; 1536 return -EFAULT;
1538 } 1537 }
1539 return 0; 1538 return 0;
@@ -1549,7 +1548,7 @@ mptctl_eventenable (unsigned long arg)
1549 int iocnum; 1548 int iocnum;
1550 1549
1551 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { 1550 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) {
1552 printk(KERN_ERR "%s@%d::mptctl_eventenable - " 1551 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - "
1553 "Unable to read in mpt_ioctl_eventenable struct @ %p\n", 1552 "Unable to read in mpt_ioctl_eventenable struct @ %p\n",
1554 __FILE__, __LINE__, uarg); 1553 __FILE__, __LINE__, uarg);
1555 return -EFAULT; 1554 return -EFAULT;
@@ -1557,7 +1556,7 @@ mptctl_eventenable (unsigned long arg)
1557 1556
1558 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1557 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1559 (ioc == NULL)) { 1558 (ioc == NULL)) {
1560 printk(KERN_DEBUG "%s::mptctl_eventenable() @%d - ioc%d not found!\n", 1559 printk(KERN_DEBUG MYNAM "%s::mptctl_eventenable() @%d - ioc%d not found!\n",
1561 __FILE__, __LINE__, iocnum); 1560 __FILE__, __LINE__, iocnum);
1562 return -ENODEV; 1561 return -ENODEV;
1563 } 1562 }
@@ -1570,7 +1569,9 @@ mptctl_eventenable (unsigned long arg)
1570 int sz = MPTCTL_EVENT_LOG_SIZE * sizeof(MPT_IOCTL_EVENTS); 1569 int sz = MPTCTL_EVENT_LOG_SIZE * sizeof(MPT_IOCTL_EVENTS);
1571 ioc->events = kzalloc(sz, GFP_KERNEL); 1570 ioc->events = kzalloc(sz, GFP_KERNEL);
1572 if (!ioc->events) { 1571 if (!ioc->events) {
1573 printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n"); 1572 printk(MYIOC_s_ERR_FMT
1573 ": ERROR - Insufficient memory to add adapter!\n",
1574 ioc->name);
1574 return -ENOMEM; 1575 return -ENOMEM;
1575 } 1576 }
1576 ioc->alloc_total += sz; 1577 ioc->alloc_total += sz;
@@ -1596,7 +1597,7 @@ mptctl_eventreport (unsigned long arg)
1596 int numBytes, maxEvents, max; 1597 int numBytes, maxEvents, max;
1597 1598
1598 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { 1599 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) {
1599 printk(KERN_ERR "%s@%d::mptctl_eventreport - " 1600 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventreport - "
1600 "Unable to read in mpt_ioctl_eventreport struct @ %p\n", 1601 "Unable to read in mpt_ioctl_eventreport struct @ %p\n",
1601 __FILE__, __LINE__, uarg); 1602 __FILE__, __LINE__, uarg);
1602 return -EFAULT; 1603 return -EFAULT;
@@ -1604,7 +1605,7 @@ mptctl_eventreport (unsigned long arg)
1604 1605
1605 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1606 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1606 (ioc == NULL)) { 1607 (ioc == NULL)) {
1607 printk(KERN_DEBUG "%s::mptctl_eventreport() @%d - ioc%d not found!\n", 1608 printk(KERN_DEBUG MYNAM "%s::mptctl_eventreport() @%d - ioc%d not found!\n",
1608 __FILE__, __LINE__, iocnum); 1609 __FILE__, __LINE__, iocnum);
1609 return -ENODEV; 1610 return -ENODEV;
1610 } 1611 }
@@ -1630,9 +1631,9 @@ mptctl_eventreport (unsigned long arg)
1630 */ 1631 */
1631 numBytes = max * sizeof(MPT_IOCTL_EVENTS); 1632 numBytes = max * sizeof(MPT_IOCTL_EVENTS);
1632 if (copy_to_user(uarg->eventData, ioc->events, numBytes)) { 1633 if (copy_to_user(uarg->eventData, ioc->events, numBytes)) {
1633 printk(KERN_ERR "%s@%d::mptctl_eventreport - " 1634 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_eventreport - "
1634 "Unable to write out mpt_ioctl_eventreport struct @ %p\n", 1635 "Unable to write out mpt_ioctl_eventreport struct @ %p\n",
1635 __FILE__, __LINE__, ioc->events); 1636 ioc->name, __FILE__, __LINE__, ioc->events);
1636 return -EFAULT; 1637 return -EFAULT;
1637 } 1638 }
1638 1639
@@ -1650,7 +1651,7 @@ mptctl_replace_fw (unsigned long arg)
1650 int newFwSize; 1651 int newFwSize;
1651 1652
1652 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { 1653 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) {
1653 printk(KERN_ERR "%s@%d::mptctl_replace_fw - " 1654 printk(KERN_ERR MYNAM "%s@%d::mptctl_replace_fw - "
1654 "Unable to read in mpt_ioctl_replace_fw struct @ %p\n", 1655 "Unable to read in mpt_ioctl_replace_fw struct @ %p\n",
1655 __FILE__, __LINE__, uarg); 1656 __FILE__, __LINE__, uarg);
1656 return -EFAULT; 1657 return -EFAULT;
@@ -1658,7 +1659,7 @@ mptctl_replace_fw (unsigned long arg)
1658 1659
1659 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1660 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1660 (ioc == NULL)) { 1661 (ioc == NULL)) {
1661 printk(KERN_DEBUG "%s::mptctl_replace_fw() @%d - ioc%d not found!\n", 1662 printk(KERN_DEBUG MYNAM "%s::mptctl_replace_fw() @%d - ioc%d not found!\n",
1662 __FILE__, __LINE__, iocnum); 1663 __FILE__, __LINE__, iocnum);
1663 return -ENODEV; 1664 return -ENODEV;
1664 } 1665 }
@@ -1688,9 +1689,9 @@ mptctl_replace_fw (unsigned long arg)
1688 /* Copy the data from user memory to kernel space 1689 /* Copy the data from user memory to kernel space
1689 */ 1690 */
1690 if (copy_from_user(ioc->cached_fw, uarg->newImage, newFwSize)) { 1691 if (copy_from_user(ioc->cached_fw, uarg->newImage, newFwSize)) {
1691 printk(KERN_ERR "%s@%d::mptctl_replace_fw - " 1692 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_replace_fw - "
1692 "Unable to read in mpt_ioctl_replace_fw image " 1693 "Unable to read in mpt_ioctl_replace_fw image "
1693 "@ %p\n", __FILE__, __LINE__, uarg); 1694 "@ %p\n", ioc->name, __FILE__, __LINE__, uarg);
1694 mpt_free_fw_memory(ioc); 1695 mpt_free_fw_memory(ioc);
1695 return -EFAULT; 1696 return -EFAULT;
1696 } 1697 }
@@ -1724,7 +1725,7 @@ mptctl_mpt_command (unsigned long arg)
1724 1725
1725 1726
1726 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_command))) { 1727 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_command))) {
1727 printk(KERN_ERR "%s@%d::mptctl_mpt_command - " 1728 printk(KERN_ERR MYNAM "%s@%d::mptctl_mpt_command - "
1728 "Unable to read in mpt_ioctl_command struct @ %p\n", 1729 "Unable to read in mpt_ioctl_command struct @ %p\n",
1729 __FILE__, __LINE__, uarg); 1730 __FILE__, __LINE__, uarg);
1730 return -EFAULT; 1731 return -EFAULT;
@@ -1732,7 +1733,7 @@ mptctl_mpt_command (unsigned long arg)
1732 1733
1733 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1734 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1734 (ioc == NULL)) { 1735 (ioc == NULL)) {
1735 printk(KERN_DEBUG "%s::mptctl_mpt_command() @%d - ioc%d not found!\n", 1736 printk(KERN_DEBUG MYNAM "%s::mptctl_mpt_command() @%d - ioc%d not found!\n",
1736 __FILE__, __LINE__, iocnum); 1737 __FILE__, __LINE__, iocnum);
1737 return -ENODEV; 1738 return -ENODEV;
1738 } 1739 }
@@ -1777,17 +1778,17 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
1777 1778
1778 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1779 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1779 (ioc == NULL)) { 1780 (ioc == NULL)) {
1780 printk(KERN_DEBUG "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n", 1781 printk(KERN_DEBUG MYNAM "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n",
1781 __FILE__, __LINE__, iocnum); 1782 __FILE__, __LINE__, iocnum);
1782 return -ENODEV; 1783 return -ENODEV;
1783 } 1784 }
1784 if (!ioc->ioctl) { 1785 if (!ioc->ioctl) {
1785 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 1786 printk(KERN_ERR MYNAM "%s@%d::mptctl_do_mpt_command - "
1786 "No memory available during driver init.\n", 1787 "No memory available during driver init.\n",
1787 __FILE__, __LINE__); 1788 __FILE__, __LINE__);
1788 return -ENOMEM; 1789 return -ENOMEM;
1789 } else if (ioc->ioctl->status & MPT_IOCTL_STATUS_DID_IOCRESET) { 1790 } else if (ioc->ioctl->status & MPT_IOCTL_STATUS_DID_IOCRESET) {
1790 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 1791 printk(KERN_ERR MYNAM "%s@%d::mptctl_do_mpt_command - "
1791 "Busy with IOC Reset \n", __FILE__, __LINE__); 1792 "Busy with IOC Reset \n", __FILE__, __LINE__);
1792 return -EBUSY; 1793 return -EBUSY;
1793 } 1794 }
@@ -1801,9 +1802,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
1801 sz += sizeof(dma_addr_t) + sizeof(u32); 1802 sz += sizeof(dma_addr_t) + sizeof(u32);
1802 1803
1803 if (sz > ioc->req_sz) { 1804 if (sz > ioc->req_sz) {
1804 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 1805 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
1805 "Request frame too large (%d) maximum (%d)\n", 1806 "Request frame too large (%d) maximum (%d)\n",
1806 __FILE__, __LINE__, sz, ioc->req_sz); 1807 ioc->name, __FILE__, __LINE__, sz, ioc->req_sz);
1807 return -EFAULT; 1808 return -EFAULT;
1808 } 1809 }
1809 1810
@@ -1821,9 +1822,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
1821 * Request frame in user space 1822 * Request frame in user space
1822 */ 1823 */
1823 if (copy_from_user(mf, mfPtr, karg.dataSgeOffset * 4)) { 1824 if (copy_from_user(mf, mfPtr, karg.dataSgeOffset * 4)) {
1824 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 1825 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
1825 "Unable to read MF from mpt_ioctl_command struct @ %p\n", 1826 "Unable to read MF from mpt_ioctl_command struct @ %p\n",
1826 __FILE__, __LINE__, mfPtr); 1827 ioc->name, __FILE__, __LINE__, mfPtr);
1827 rc = -EFAULT; 1828 rc = -EFAULT;
1828 goto done_free_mem; 1829 goto done_free_mem;
1829 } 1830 }
@@ -1874,17 +1875,17 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
1874 1875
1875 id = (ioc->devices_per_bus == 0) ? 256 : ioc->devices_per_bus; 1876 id = (ioc->devices_per_bus == 0) ? 256 : ioc->devices_per_bus;
1876 if (pScsiReq->TargetID > id) { 1877 if (pScsiReq->TargetID > id) {
1877 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 1878 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
1878 "Target ID out of bounds. \n", 1879 "Target ID out of bounds. \n",
1879 __FILE__, __LINE__); 1880 ioc->name, __FILE__, __LINE__);
1880 rc = -ENODEV; 1881 rc = -ENODEV;
1881 goto done_free_mem; 1882 goto done_free_mem;
1882 } 1883 }
1883 1884
1884 if (pScsiReq->Bus >= ioc->number_of_buses) { 1885 if (pScsiReq->Bus >= ioc->number_of_buses) {
1885 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 1886 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
1886 "Target Bus out of bounds. \n", 1887 "Target Bus out of bounds. \n",
1887 __FILE__, __LINE__); 1888 ioc->name, __FILE__, __LINE__);
1888 rc = -ENODEV; 1889 rc = -ENODEV;
1889 goto done_free_mem; 1890 goto done_free_mem;
1890 } 1891 }
@@ -1936,9 +1937,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
1936 ioc->ioctl->id = pScsiReq->TargetID; 1937 ioc->ioctl->id = pScsiReq->TargetID;
1937 1938
1938 } else { 1939 } else {
1939 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 1940 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
1940 "SCSI driver is not loaded. \n", 1941 "SCSI driver is not loaded. \n",
1941 __FILE__, __LINE__); 1942 ioc->name, __FILE__, __LINE__);
1942 rc = -EFAULT; 1943 rc = -EFAULT;
1943 goto done_free_mem; 1944 goto done_free_mem;
1944 } 1945 }
@@ -1955,9 +1956,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
1955 1956
1956 case MPI_FUNCTION_SATA_PASSTHROUGH: 1957 case MPI_FUNCTION_SATA_PASSTHROUGH:
1957 if (!ioc->sh) { 1958 if (!ioc->sh) {
1958 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 1959 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
1959 "SCSI driver is not loaded. \n", 1960 "SCSI driver is not loaded. \n",
1960 __FILE__, __LINE__); 1961 ioc->name, __FILE__, __LINE__);
1961 rc = -EFAULT; 1962 rc = -EFAULT;
1962 goto done_free_mem; 1963 goto done_free_mem;
1963 } 1964 }
@@ -2014,9 +2015,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2014 ioc->ioctl->reset = MPTCTL_RESET_OK; 2015 ioc->ioctl->reset = MPTCTL_RESET_OK;
2015 ioc->ioctl->id = pScsiReq->TargetID; 2016 ioc->ioctl->id = pScsiReq->TargetID;
2016 } else { 2017 } else {
2017 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 2018 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
2018 "SCSI driver is not loaded. \n", 2019 "SCSI driver is not loaded. \n",
2019 __FILE__, __LINE__); 2020 ioc->name, __FILE__, __LINE__);
2020 rc = -EFAULT; 2021 rc = -EFAULT;
2021 goto done_free_mem; 2022 goto done_free_mem;
2022 } 2023 }
@@ -2026,9 +2027,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2026 { 2027 {
2027 MPT_SCSI_HOST *hd = NULL; 2028 MPT_SCSI_HOST *hd = NULL;
2028 if ((ioc->sh == NULL) || ((hd = (MPT_SCSI_HOST *)ioc->sh->hostdata) == NULL)) { 2029 if ((ioc->sh == NULL) || ((hd = (MPT_SCSI_HOST *)ioc->sh->hostdata) == NULL)) {
2029 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 2030 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
2030 "SCSI driver not loaded or SCSI host not found. \n", 2031 "SCSI driver not loaded or SCSI host not found. \n",
2031 __FILE__, __LINE__); 2032 ioc->name, __FILE__, __LINE__);
2032 rc = -EFAULT; 2033 rc = -EFAULT;
2033 goto done_free_mem; 2034 goto done_free_mem;
2034 } else if (mptctl_set_tm_flags(hd) != 0) { 2035 } else if (mptctl_set_tm_flags(hd) != 0) {
@@ -2059,9 +2060,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2059 (pInit->ReplyFrameSize != cpu_to_le16(ioc->reply_sz)) || 2060 (pInit->ReplyFrameSize != cpu_to_le16(ioc->reply_sz)) ||
2060 (pInit->HostMfaHighAddr != high_addr) || 2061 (pInit->HostMfaHighAddr != high_addr) ||
2061 (pInit->SenseBufferHighAddr != sense_high)) { 2062 (pInit->SenseBufferHighAddr != sense_high)) {
2062 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 2063 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
2063 "IOC_INIT issued with 1 or more incorrect parameters. Rejected.\n", 2064 "IOC_INIT issued with 1 or more incorrect parameters. Rejected.\n",
2064 __FILE__, __LINE__); 2065 ioc->name, __FILE__, __LINE__);
2065 rc = -EFAULT; 2066 rc = -EFAULT;
2066 goto done_free_mem; 2067 goto done_free_mem;
2067 } 2068 }
@@ -2092,9 +2093,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2092 MPI_FUNCTION_LAN_RESET 2093 MPI_FUNCTION_LAN_RESET
2093 */ 2094 */
2094 2095
2095 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 2096 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
2096 "Illegal request (function 0x%x) \n", 2097 "Illegal request (function 0x%x) \n",
2097 __FILE__, __LINE__, hdr->Function); 2098 ioc->name, __FILE__, __LINE__, hdr->Function);
2098 rc = -EFAULT; 2099 rc = -EFAULT;
2099 goto done_free_mem; 2100 goto done_free_mem;
2100 } 2101 }
@@ -2151,11 +2152,11 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2151 if (copy_from_user(bufOut.kptr, 2152 if (copy_from_user(bufOut.kptr,
2152 karg.dataOutBufPtr, 2153 karg.dataOutBufPtr,
2153 bufOut.len)) { 2154 bufOut.len)) {
2154 printk(KERN_ERR 2155 printk(MYIOC_s_ERR_FMT
2155 "%s@%d::mptctl_do_mpt_command - Unable " 2156 "%s@%d::mptctl_do_mpt_command - Unable "
2156 "to read user data " 2157 "to read user data "
2157 "struct @ %p\n", 2158 "struct @ %p\n",
2158 __FILE__, __LINE__,karg.dataOutBufPtr); 2159 ioc->name, __FILE__, __LINE__,karg.dataOutBufPtr);
2159 rc = -EFAULT; 2160 rc = -EFAULT;
2160 goto done_free_mem; 2161 goto done_free_mem;
2161 } 2162 }
@@ -2242,10 +2243,10 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2242 if (sz > 0) { 2243 if (sz > 0) {
2243 if (copy_to_user(karg.replyFrameBufPtr, 2244 if (copy_to_user(karg.replyFrameBufPtr,
2244 &ioc->ioctl->ReplyFrame, sz)){ 2245 &ioc->ioctl->ReplyFrame, sz)){
2245 printk(KERN_ERR 2246 printk(MYIOC_s_ERR_FMT
2246 "%s@%d::mptctl_do_mpt_command - " 2247 "%s@%d::mptctl_do_mpt_command - "
2247 "Unable to write out reply frame %p\n", 2248 "Unable to write out reply frame %p\n",
2248 __FILE__, __LINE__, karg.replyFrameBufPtr); 2249 ioc->name, __FILE__, __LINE__, karg.replyFrameBufPtr);
2249 rc = -ENODATA; 2250 rc = -ENODATA;
2250 goto done_free_mem; 2251 goto done_free_mem;
2251 } 2252 }
@@ -2258,9 +2259,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2258 sz = min(karg.maxSenseBytes, MPT_SENSE_BUFFER_SIZE); 2259 sz = min(karg.maxSenseBytes, MPT_SENSE_BUFFER_SIZE);
2259 if (sz > 0) { 2260 if (sz > 0) {
2260 if (copy_to_user(karg.senseDataPtr, ioc->ioctl->sense, sz)) { 2261 if (copy_to_user(karg.senseDataPtr, ioc->ioctl->sense, sz)) {
2261 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 2262 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
2262 "Unable to write sense data to user %p\n", 2263 "Unable to write sense data to user %p\n",
2263 __FILE__, __LINE__, 2264 ioc->name, __FILE__, __LINE__,
2264 karg.senseDataPtr); 2265 karg.senseDataPtr);
2265 rc = -ENODATA; 2266 rc = -ENODATA;
2266 goto done_free_mem; 2267 goto done_free_mem;
@@ -2276,9 +2277,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2276 2277
2277 if (copy_to_user(karg.dataInBufPtr, 2278 if (copy_to_user(karg.dataInBufPtr,
2278 bufIn.kptr, karg.dataInSize)) { 2279 bufIn.kptr, karg.dataInSize)) {
2279 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - " 2280 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
2280 "Unable to write data to user %p\n", 2281 "Unable to write data to user %p\n",
2281 __FILE__, __LINE__, 2282 ioc->name, __FILE__, __LINE__,
2282 karg.dataInBufPtr); 2283 karg.dataInBufPtr);
2283 rc = -ENODATA; 2284 rc = -ENODATA;
2284 } 2285 }
@@ -2349,7 +2350,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
2349 return -EFAULT; 2350 return -EFAULT;
2350 2351
2351 if (copy_from_user(&karg, uarg, sizeof(hp_host_info_t))) { 2352 if (copy_from_user(&karg, uarg, sizeof(hp_host_info_t))) {
2352 printk(KERN_ERR "%s@%d::mptctl_hp_host_info - " 2353 printk(KERN_ERR MYNAM "%s@%d::mptctl_hp_host_info - "
2353 "Unable to read in hp_host_info struct @ %p\n", 2354 "Unable to read in hp_host_info struct @ %p\n",
2354 __FILE__, __LINE__, uarg); 2355 __FILE__, __LINE__, uarg);
2355 return -EFAULT; 2356 return -EFAULT;
@@ -2357,7 +2358,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
2357 2358
2358 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 2359 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2359 (ioc == NULL)) { 2360 (ioc == NULL)) {
2360 printk(KERN_DEBUG "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n", 2361 printk(KERN_DEBUG MYNAM "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n",
2361 __FILE__, __LINE__, iocnum); 2362 __FILE__, __LINE__, iocnum);
2362 return -ENODEV; 2363 return -ENODEV;
2363 } 2364 }
@@ -2538,9 +2539,9 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
2538 /* Copy the data from kernel memory to user memory 2539 /* Copy the data from kernel memory to user memory
2539 */ 2540 */
2540 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_host_info_t))) { 2541 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_host_info_t))) {
2541 printk(KERN_ERR "%s@%d::mptctl_hpgethostinfo - " 2542 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_hpgethostinfo - "
2542 "Unable to write out hp_host_info @ %p\n", 2543 "Unable to write out hp_host_info @ %p\n",
2543 __FILE__, __LINE__, uarg); 2544 ioc->name, __FILE__, __LINE__, uarg);
2544 return -EFAULT; 2545 return -EFAULT;
2545 } 2546 }
2546 2547
@@ -2576,7 +2577,7 @@ mptctl_hp_targetinfo(unsigned long arg)
2576 int tmp, np, rc = 0; 2577 int tmp, np, rc = 0;
2577 2578
2578 if (copy_from_user(&karg, uarg, sizeof(hp_target_info_t))) { 2579 if (copy_from_user(&karg, uarg, sizeof(hp_target_info_t))) {
2579 printk(KERN_ERR "%s@%d::mptctl_hp_targetinfo - " 2580 printk(KERN_ERR MYNAM "%s@%d::mptctl_hp_targetinfo - "
2580 "Unable to read in hp_host_targetinfo struct @ %p\n", 2581 "Unable to read in hp_host_targetinfo struct @ %p\n",
2581 __FILE__, __LINE__, uarg); 2582 __FILE__, __LINE__, uarg);
2582 return -EFAULT; 2583 return -EFAULT;
@@ -2584,11 +2585,11 @@ mptctl_hp_targetinfo(unsigned long arg)
2584 2585
2585 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 2586 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2586 (ioc == NULL)) { 2587 (ioc == NULL)) {
2587 printk(KERN_DEBUG "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n", 2588 printk(KERN_DEBUG MYNAM "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n",
2588 __FILE__, __LINE__, iocnum); 2589 __FILE__, __LINE__, iocnum);
2589 return -ENODEV; 2590 return -ENODEV;
2590 } 2591 }
2591 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_targetinfo called.\n", 2592 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n",
2592 ioc->name)); 2593 ioc->name));
2593 2594
2594 /* There is nothing to do for FCP parts. 2595 /* There is nothing to do for FCP parts.
@@ -2689,9 +2690,9 @@ mptctl_hp_targetinfo(unsigned long arg)
2689 /* Copy the data from kernel memory to user memory 2690 /* Copy the data from kernel memory to user memory
2690 */ 2691 */
2691 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_target_info_t))) { 2692 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_target_info_t))) {
2692 printk(KERN_ERR "%s@%d::mptctl_hp_target_info - " 2693 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_hp_target_info - "
2693 "Unable to write out mpt_ioctl_targetinfo struct @ %p\n", 2694 "Unable to write out mpt_ioctl_targetinfo struct @ %p\n",
2694 __FILE__, __LINE__, uarg); 2695 ioc->name, __FILE__, __LINE__, uarg);
2695 return -EFAULT; 2696 return -EFAULT;
2696 } 2697 }
2697 2698
@@ -2741,7 +2742,7 @@ compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd,
2741 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || 2742 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
2742 (iocp == NULL)) { 2743 (iocp == NULL)) {
2743 printk(KERN_DEBUG MYNAM "::compat_mptfwxfer_ioctl @%d - ioc%d not found!\n", 2744 printk(KERN_DEBUG MYNAM "::compat_mptfwxfer_ioctl @%d - ioc%d not found!\n",
2744 __LINE__, iocnumX); 2745 __LINE__, iocnumX);
2745 return -ENODEV; 2746 return -ENODEV;
2746 } 2747 }
2747 2748
@@ -2781,7 +2782,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd,
2781 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || 2782 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) ||
2782 (iocp == NULL)) { 2783 (iocp == NULL)) {
2783 printk(KERN_DEBUG MYNAM "::compat_mpt_command @%d - ioc%d not found!\n", 2784 printk(KERN_DEBUG MYNAM "::compat_mpt_command @%d - ioc%d not found!\n",
2784 __LINE__, iocnumX); 2785 __LINE__, iocnumX);
2785 return -ENODEV; 2786 return -ENODEV;
2786 } 2787 }
2787 2788
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index 0586f87ffb19..6c6299485f4e 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -204,7 +204,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
204 "DID_IMM_RETRY, deferring %s recovery.\n", 204 "DID_IMM_RETRY, deferring %s recovery.\n",
205 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, 205 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
206 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no, 206 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
207 SCpnt->device->id,SCpnt->device->lun,caller)); 207 SCpnt->device->id, SCpnt->device->lun, caller));
208 msleep(1000); 208 msleep(1000);
209 spin_lock_irqsave(shost->host_lock, flags); 209 spin_lock_irqsave(shost->host_lock, flags);
210 } 210 }
@@ -216,7 +216,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
216 "port state %d, vdev %p.\n", caller, 216 "port state %d, vdev %p.\n", caller,
217 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, 217 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
218 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no, 218 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
219 SCpnt->device->id,SCpnt->device->lun,ready, 219 SCpnt->device->id, SCpnt->device->lun, ready,
220 SCpnt->device->hostdata)); 220 SCpnt->device->hostdata));
221 return FAILED; 221 return FAILED;
222 } 222 }
@@ -224,7 +224,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
224 "%s.%d: %d:%d, executing recovery.\n", caller, 224 "%s.%d: %d:%d, executing recovery.\n", caller,
225 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, 225 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
226 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no, 226 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
227 SCpnt->device->id,SCpnt->device->lun)); 227 SCpnt->device->id, SCpnt->device->lun));
228 return (*func)(SCpnt); 228 return (*func)(SCpnt);
229} 229}
230 230
@@ -1320,8 +1320,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1320 sh->transportt = mptfc_transport_template; 1320 sh->transportt = mptfc_transport_template;
1321 error = scsi_add_host (sh, &ioc->pcidev->dev); 1321 error = scsi_add_host (sh, &ioc->pcidev->dev);
1322 if(error) { 1322 if(error) {
1323 dprintk(ioc, printk(KERN_ERR MYNAM 1323 dprintk(ioc, printk(MYIOC_s_ERR_FMT
1324 "scsi_add_host failed\n")); 1324 "scsi_add_host failed\n", ioc->name));
1325 goto out_mptfc_probe; 1325 goto out_mptfc_probe;
1326 } 1326 }
1327 1327
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 4333449ae654..ecaa1d6b0759 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -100,19 +100,25 @@ static void mptsas_hotplug_work(struct work_struct *work);
100static void mptsas_print_phy_data(MPT_ADAPTER *ioc, 100static void mptsas_print_phy_data(MPT_ADAPTER *ioc,
101 MPI_SAS_IO_UNIT0_PHY_DATA *phy_data) 101 MPI_SAS_IO_UNIT0_PHY_DATA *phy_data)
102{ 102{
103 dsasprintk(ioc, printk(KERN_DEBUG "---- IO UNIT PAGE 0 ------------\n")); 103 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
104 dsasprintk(ioc, printk(KERN_DEBUG "Handle=0x%X\n", 104 "---- IO UNIT PAGE 0 ------------\n", ioc->name));
105 le16_to_cpu(phy_data->AttachedDeviceHandle))); 105 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handle=0x%X\n",
106 dsasprintk(ioc, printk(KERN_DEBUG "Controller Handle=0x%X\n", 106 ioc->name, le16_to_cpu(phy_data->AttachedDeviceHandle)));
107 le16_to_cpu(phy_data->ControllerDevHandle))); 107 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Controller Handle=0x%X\n",
108 dsasprintk(ioc, printk(KERN_DEBUG "Port=0x%X\n", phy_data->Port)); 108 ioc->name, le16_to_cpu(phy_data->ControllerDevHandle)));
109 dsasprintk(ioc, printk(KERN_DEBUG "Port Flags=0x%X\n", phy_data->PortFlags)); 109 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Port=0x%X\n",
110 dsasprintk(ioc, printk(KERN_DEBUG "PHY Flags=0x%X\n", phy_data->PhyFlags)); 110 ioc->name, phy_data->Port));
111 dsasprintk(ioc, printk(KERN_DEBUG "Negotiated Link Rate=0x%X\n", phy_data->NegotiatedLinkRate)); 111 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Port Flags=0x%X\n",
112 dsasprintk(ioc, printk(KERN_DEBUG "Controller PHY Device Info=0x%X\n", 112 ioc->name, phy_data->PortFlags));
113 le32_to_cpu(phy_data->ControllerPhyDeviceInfo))); 113 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PHY Flags=0x%X\n",
114 dsasprintk(ioc, printk(KERN_DEBUG "DiscoveryStatus=0x%X\n\n", 114 ioc->name, phy_data->PhyFlags));
115 le32_to_cpu(phy_data->DiscoveryStatus))); 115 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Negotiated Link Rate=0x%X\n",
116 ioc->name, phy_data->NegotiatedLinkRate));
117 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
118 "Controller PHY Device Info=0x%X\n", ioc->name,
119 le32_to_cpu(phy_data->ControllerPhyDeviceInfo)));
120 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "DiscoveryStatus=0x%X\n\n",
121 ioc->name, le32_to_cpu(phy_data->DiscoveryStatus)));
116} 122}
117 123
118static void mptsas_print_phy_pg0(MPT_ADAPTER *ioc, SasPhyPage0_t *pg0) 124static void mptsas_print_phy_pg0(MPT_ADAPTER *ioc, SasPhyPage0_t *pg0)
@@ -121,27 +127,41 @@ static void mptsas_print_phy_pg0(MPT_ADAPTER *ioc, SasPhyPage0_t *pg0)
121 127
122 memcpy(&sas_address, &pg0->SASAddress, sizeof(__le64)); 128 memcpy(&sas_address, &pg0->SASAddress, sizeof(__le64));
123 129
124 dsasprintk(ioc, printk(KERN_DEBUG "---- SAS PHY PAGE 0 ------------\n")); 130 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
125 dsasprintk(ioc, printk(KERN_DEBUG "Attached Device Handle=0x%X\n", 131 "---- SAS PHY PAGE 0 ------------\n", ioc->name));
126 le16_to_cpu(pg0->AttachedDevHandle))); 132 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
127 dsasprintk(ioc, printk(KERN_DEBUG "SAS Address=0x%llX\n", 133 "Attached Device Handle=0x%X\n", ioc->name,
128 (unsigned long long)le64_to_cpu(sas_address))); 134 le16_to_cpu(pg0->AttachedDevHandle)));
129 dsasprintk(ioc, printk(KERN_DEBUG "Attached PHY Identifier=0x%X\n", pg0->AttachedPhyIdentifier)); 135 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "SAS Address=0x%llX\n",
130 dsasprintk(ioc, printk(KERN_DEBUG "Attached Device Info=0x%X\n", 136 ioc->name, (unsigned long long)le64_to_cpu(sas_address)));
131 le32_to_cpu(pg0->AttachedDeviceInfo))); 137 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
132 dsasprintk(ioc, printk(KERN_DEBUG "Programmed Link Rate=0x%X\n", pg0->ProgrammedLinkRate)); 138 "Attached PHY Identifier=0x%X\n", ioc->name,
133 dsasprintk(ioc, printk(KERN_DEBUG "Change Count=0x%X\n", pg0->ChangeCount)); 139 pg0->AttachedPhyIdentifier));
134 dsasprintk(ioc, printk(KERN_DEBUG "PHY Info=0x%X\n\n", le32_to_cpu(pg0->PhyInfo))); 140 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Attached Device Info=0x%X\n",
141 ioc->name, le32_to_cpu(pg0->AttachedDeviceInfo)));
142 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Programmed Link Rate=0x%X\n",
143 ioc->name, pg0->ProgrammedLinkRate));
144 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Change Count=0x%X\n",
145 ioc->name, pg0->ChangeCount));
146 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PHY Info=0x%X\n\n",
147 ioc->name, le32_to_cpu(pg0->PhyInfo)));
135} 148}
136 149
137static void mptsas_print_phy_pg1(MPT_ADAPTER *ioc, SasPhyPage1_t *pg1) 150static void mptsas_print_phy_pg1(MPT_ADAPTER *ioc, SasPhyPage1_t *pg1)
138{ 151{
139 dsasprintk(ioc, printk(KERN_DEBUG "---- SAS PHY PAGE 1 ------------\n")); 152 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
140 dsasprintk(ioc, printk(KERN_DEBUG "Invalid Dword Count=0x%x\n", pg1->InvalidDwordCount)); 153 "---- SAS PHY PAGE 1 ------------\n", ioc->name));
141 dsasprintk(ioc, printk(KERN_DEBUG "Running Disparity Error Count=0x%x\n", 154 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Invalid Dword Count=0x%x\n",
142 pg1->RunningDisparityErrorCount)); 155 ioc->name, pg1->InvalidDwordCount));
143 dsasprintk(ioc, printk(KERN_DEBUG "Loss Dword Synch Count=0x%x\n", pg1->LossDwordSynchCount)); 156 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
144 dsasprintk(ioc, printk(KERN_DEBUG "PHY Reset Problem Count=0x%x\n\n", pg1->PhyResetProblemCount)); 157 "Running Disparity Error Count=0x%x\n", ioc->name,
158 pg1->RunningDisparityErrorCount));
159 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
160 "Loss Dword Synch Count=0x%x\n", ioc->name,
161 pg1->LossDwordSynchCount));
162 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
163 "PHY Reset Problem Count=0x%x\n\n", ioc->name,
164 pg1->PhyResetProblemCount));
145} 165}
146 166
147static void mptsas_print_device_pg0(MPT_ADAPTER *ioc, SasDevicePage0_t *pg0) 167static void mptsas_print_device_pg0(MPT_ADAPTER *ioc, SasDevicePage0_t *pg0)
@@ -150,37 +170,53 @@ static void mptsas_print_device_pg0(MPT_ADAPTER *ioc, SasDevicePage0_t *pg0)
150 170
151 memcpy(&sas_address, &pg0->SASAddress, sizeof(__le64)); 171 memcpy(&sas_address, &pg0->SASAddress, sizeof(__le64));
152 172
153 dsasprintk(ioc, printk(KERN_DEBUG "---- SAS DEVICE PAGE 0 ---------\n")); 173 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
154 dsasprintk(ioc, printk(KERN_DEBUG "Handle=0x%X\n" ,le16_to_cpu(pg0->DevHandle))); 174 "---- SAS DEVICE PAGE 0 ---------\n", ioc->name));
155 dsasprintk(ioc, printk(KERN_DEBUG "Parent Handle=0x%X\n" ,le16_to_cpu(pg0->ParentDevHandle))); 175 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handle=0x%X\n",
156 dsasprintk(ioc, printk(KERN_DEBUG "Enclosure Handle=0x%X\n", le16_to_cpu(pg0->EnclosureHandle))); 176 ioc->name, le16_to_cpu(pg0->DevHandle)));
157 dsasprintk(ioc, printk(KERN_DEBUG "Slot=0x%X\n", le16_to_cpu(pg0->Slot))); 177 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Parent Handle=0x%X\n",
158 dsasprintk(ioc, printk(KERN_DEBUG "SAS Address=0x%llX\n", (unsigned long long) 178 ioc->name, le16_to_cpu(pg0->ParentDevHandle)));
159 le64_to_cpu(sas_address))); 179 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Enclosure Handle=0x%X\n",
160 dsasprintk(ioc, printk(KERN_DEBUG "Target ID=0x%X\n", pg0->TargetID)); 180 ioc->name, le16_to_cpu(pg0->EnclosureHandle)));
161 dsasprintk(ioc, printk(KERN_DEBUG "Bus=0x%X\n", pg0->Bus)); 181 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Slot=0x%X\n",
162 /* The PhyNum field specifies the PHY number of the parent 182 ioc->name, le16_to_cpu(pg0->Slot)));
163 * device this device is linked to 183 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "SAS Address=0x%llX\n",
164 */ 184 ioc->name, (unsigned long long)le64_to_cpu(sas_address)));
165 dsasprintk(ioc, printk(KERN_DEBUG "Parent Phy Num=0x%X\n", pg0->PhyNum)); 185 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Target ID=0x%X\n",
166 dsasprintk(ioc, printk(KERN_DEBUG "Access Status=0x%X\n", le16_to_cpu(pg0->AccessStatus))); 186 ioc->name, pg0->TargetID));
167 dsasprintk(ioc, printk(KERN_DEBUG "Device Info=0x%X\n", le32_to_cpu(pg0->DeviceInfo))); 187 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Bus=0x%X\n",
168 dsasprintk(ioc, printk(KERN_DEBUG "Flags=0x%X\n", le16_to_cpu(pg0->Flags))); 188 ioc->name, pg0->Bus));
169 dsasprintk(ioc, printk(KERN_DEBUG "Physical Port=0x%X\n\n", pg0->PhysicalPort)); 189 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Parent Phy Num=0x%X\n",
190 ioc->name, pg0->PhyNum));
191 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Access Status=0x%X\n",
192 ioc->name, le16_to_cpu(pg0->AccessStatus)));
193 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Device Info=0x%X\n",
194 ioc->name, le32_to_cpu(pg0->DeviceInfo)));
195 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Flags=0x%X\n",
196 ioc->name, le16_to_cpu(pg0->Flags)));
197 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Physical Port=0x%X\n\n",
198 ioc->name, pg0->PhysicalPort));
170} 199}
171 200
172static void mptsas_print_expander_pg1(MPT_ADAPTER *ioc, SasExpanderPage1_t *pg1) 201static void mptsas_print_expander_pg1(MPT_ADAPTER *ioc, SasExpanderPage1_t *pg1)
173{ 202{
174 dsasprintk(ioc, printk(KERN_DEBUG "---- SAS EXPANDER PAGE 1 ------------\n")); 203 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
175 dsasprintk(ioc, printk(KERN_DEBUG "Physical Port=0x%X\n", pg1->PhysicalPort)); 204 "---- SAS EXPANDER PAGE 1 ------------\n", ioc->name));
176 dsasprintk(ioc, printk(KERN_DEBUG "PHY Identifier=0x%X\n", pg1->PhyIdentifier)); 205 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Physical Port=0x%X\n",
177 dsasprintk(ioc, printk(KERN_DEBUG "Negotiated Link Rate=0x%X\n", pg1->NegotiatedLinkRate)); 206 ioc->name, pg1->PhysicalPort));
178 dsasprintk(ioc, printk(KERN_DEBUG "Programmed Link Rate=0x%X\n", pg1->ProgrammedLinkRate)); 207 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PHY Identifier=0x%X\n",
179 dsasprintk(ioc, printk(KERN_DEBUG "Hardware Link Rate=0x%X\n", pg1->HwLinkRate)); 208 ioc->name, pg1->PhyIdentifier));
180 dsasprintk(ioc, printk(KERN_DEBUG "Owner Device Handle=0x%X\n", 209 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Negotiated Link Rate=0x%X\n",
181 le16_to_cpu(pg1->OwnerDevHandle))); 210 ioc->name, pg1->NegotiatedLinkRate));
182 dsasprintk(ioc, printk(KERN_DEBUG "Attached Device Handle=0x%X\n\n", 211 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Programmed Link Rate=0x%X\n",
183 le16_to_cpu(pg1->AttachedDevHandle))); 212 ioc->name, pg1->ProgrammedLinkRate));
213 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Hardware Link Rate=0x%X\n",
214 ioc->name, pg1->HwLinkRate));
215 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Owner Device Handle=0x%X\n",
216 ioc->name, le16_to_cpu(pg1->OwnerDevHandle)));
217 dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT
218 "Attached Device Handle=0x%X\n\n", ioc->name,
219 le16_to_cpu(pg1->AttachedDevHandle)));
184} 220}
185 221
186static inline MPT_ADAPTER *phy_to_ioc(struct sas_phy *phy) 222static inline MPT_ADAPTER *phy_to_ioc(struct sas_phy *phy)
@@ -250,8 +286,8 @@ mptsas_port_delete(MPT_ADAPTER *ioc, struct mptsas_portinfo_details * port_detai
250 port_info = port_details->port_info; 286 port_info = port_details->port_info;
251 phy_info = port_info->phy_info; 287 phy_info = port_info->phy_info;
252 288
253 dsaswideprintk(ioc, printk(KERN_DEBUG "%s: [%p]: num_phys=%02d " 289 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "%s: [%p]: num_phys=%02d "
254 "bitmask=0x%016llX\n", __FUNCTION__, port_details, 290 "bitmask=0x%016llX\n", ioc->name, __FUNCTION__, port_details,
255 port_details->num_phys, (unsigned long long) 291 port_details->num_phys, (unsigned long long)
256 port_details->phy_bitmask)); 292 port_details->phy_bitmask));
257 293
@@ -278,14 +314,15 @@ mptsas_set_rphy(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, struct sas_rp
278{ 314{
279 if (phy_info->port_details) { 315 if (phy_info->port_details) {
280 phy_info->port_details->rphy = rphy; 316 phy_info->port_details->rphy = rphy;
281 dsaswideprintk(ioc, printk(KERN_DEBUG "sas_rphy_add: rphy=%p\n", rphy)); 317 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "sas_rphy_add: rphy=%p\n",
318 ioc->name, rphy));
282 } 319 }
283 320
284 if (rphy) { 321 if (rphy) {
285 dsaswideprintk(ioc, dev_printk(KERN_DEBUG, 322 dsaswideprintk(ioc, dev_printk(MYIOC_s_DEBUG_FMT,
286 &rphy->dev, "add:")); 323 &rphy->dev, "add:", ioc->name));
287 dsaswideprintk(ioc, printk(KERN_DEBUG "rphy=%p release=%p\n", 324 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "rphy=%p release=%p\n",
288 rphy, rphy->dev.release)); 325 ioc->name, rphy, rphy->dev.release));
289 } 326 }
290} 327}
291 328
@@ -305,10 +342,10 @@ mptsas_set_port(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, struct sas_po
305 phy_info->port_details->port = port; 342 phy_info->port_details->port = port;
306 343
307 if (port) { 344 if (port) {
308 dsaswideprintk(ioc, dev_printk(KERN_DEBUG, 345 dsaswideprintk(ioc, dev_printk(MYIOC_s_DEBUG_FMT,
309 &port->dev, "add:")); 346 &port->dev, "add:", ioc->name));
310 dsaswideprintk(ioc, printk(KERN_DEBUG "port=%p release=%p\n", 347 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "port=%p release=%p\n",
311 port, port->dev.release)); 348 ioc->name, port, port->dev.release));
312 } 349 }
313} 350}
314 351
@@ -359,9 +396,9 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
359 * Removing a phy from a port, letting the last 396 * Removing a phy from a port, letting the last
360 * phy be removed by firmware events. 397 * phy be removed by firmware events.
361 */ 398 */
362 dsaswideprintk(ioc, printk(KERN_DEBUG 399 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT
363 "%s: [%p]: deleting phy = %d\n", 400 "%s: [%p]: deleting phy = %d\n",
364 __FUNCTION__, port_details, i)); 401 ioc->name, __FUNCTION__, port_details, i));
365 port_details->num_phys--; 402 port_details->num_phys--;
366 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id); 403 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id);
367 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo)); 404 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
@@ -375,8 +412,8 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
375 phy_info = port_info->phy_info; 412 phy_info = port_info->phy_info;
376 for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) { 413 for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) {
377 sas_address = phy_info->attached.sas_address; 414 sas_address = phy_info->attached.sas_address;
378 dsaswideprintk(ioc, printk(KERN_DEBUG "phy_id=%d sas_address=0x%018llX\n", 415 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "phy_id=%d sas_address=0x%018llX\n",
379 i, (unsigned long long)sas_address)); 416 ioc->name, i, (unsigned long long)sas_address));
380 if (!sas_address) 417 if (!sas_address)
381 continue; 418 continue;
382 port_details = phy_info->port_details; 419 port_details = phy_info->port_details;
@@ -394,9 +431,9 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
394 port_details->phy_bitmask |= 431 port_details->phy_bitmask |=
395 (1 << phy_info->phy_id); 432 (1 << phy_info->phy_id);
396 phy_info->sas_port_add_phy=1; 433 phy_info->sas_port_add_phy=1;
397 dsaswideprintk(ioc, printk(KERN_DEBUG "\t\tForming port\n\t\t" 434 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "\t\tForming port\n\t\t"
398 "phy_id=%d sas_address=0x%018llX\n", 435 "phy_id=%d sas_address=0x%018llX\n",
399 i, (unsigned long long)sas_address)); 436 ioc->name, i, (unsigned long long)sas_address));
400 phy_info->port_details = port_details; 437 phy_info->port_details = port_details;
401 } 438 }
402 439
@@ -411,9 +448,9 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
411 continue; 448 continue;
412 if (phy_info_cmp->port_details == port_details ) 449 if (phy_info_cmp->port_details == port_details )
413 continue; 450 continue;
414 dsaswideprintk(ioc, printk(KERN_DEBUG 451 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT
415 "\t\tphy_id=%d sas_address=0x%018llX\n", 452 "\t\tphy_id=%d sas_address=0x%018llX\n",
416 j, (unsigned long long) 453 ioc->name, j, (unsigned long long)
417 phy_info_cmp->attached.sas_address)); 454 phy_info_cmp->attached.sas_address));
418 if (phy_info_cmp->port_details) { 455 if (phy_info_cmp->port_details) {
419 port_details->rphy = 456 port_details->rphy =
@@ -445,15 +482,15 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
445 port_details = port_info->phy_info[i].port_details; 482 port_details = port_info->phy_info[i].port_details;
446 if (!port_details) 483 if (!port_details)
447 continue; 484 continue;
448 dsaswideprintk(ioc, printk(KERN_DEBUG 485 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT
449 "%s: [%p]: phy_id=%02d num_phys=%02d " 486 "%s: [%p]: phy_id=%02d num_phys=%02d "
450 "bitmask=0x%016llX\n", __FUNCTION__, 487 "bitmask=0x%016llX\n", ioc->name, __FUNCTION__,
451 port_details, i, port_details->num_phys, 488 port_details, i, port_details->num_phys,
452 (unsigned long long)port_details->phy_bitmask)); 489 (unsigned long long)port_details->phy_bitmask));
453 dsaswideprintk(ioc, printk(KERN_DEBUG"\t\tport = %p rphy=%p\n", 490 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "\t\tport = %p rphy=%p\n",
454 port_details->port, port_details->rphy)); 491 ioc->name, port_details->port, port_details->rphy));
455 } 492 }
456 dsaswideprintk(ioc, printk(KERN_DEBUG"\n")); 493 dsaswideprintk(ioc, printk("\n"));
457 mutex_unlock(&ioc->sas_topology_mutex); 494 mutex_unlock(&ioc->sas_topology_mutex);
458} 495}
459 496
@@ -1129,10 +1166,8 @@ static int mptsas_phy_reset(struct sas_phy *phy, int hard_reset)
1129 /* process the completed Reply Message Frame */ 1166 /* process the completed Reply Message Frame */
1130 reply = (SasIoUnitControlReply_t *)ioc->sas_mgmt.reply; 1167 reply = (SasIoUnitControlReply_t *)ioc->sas_mgmt.reply;
1131 if (reply->IOCStatus != MPI_IOCSTATUS_SUCCESS) { 1168 if (reply->IOCStatus != MPI_IOCSTATUS_SUCCESS) {
1132 printk("%s: IOCStatus=0x%X IOCLogInfo=0x%X\n", 1169 printk(MYIOC_s_INFO_FMT "%s: IOCStatus=0x%X IOCLogInfo=0x%X\n",
1133 __FUNCTION__, 1170 ioc->name, __FUNCTION__, reply->IOCStatus, reply->IOCLogInfo);
1134 reply->IOCStatus,
1135 reply->IOCLogInfo);
1136 error = -ENXIO; 1171 error = -ENXIO;
1137 goto out_unlock; 1172 goto out_unlock;
1138 } 1173 }
@@ -1218,16 +1253,16 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1218 u64 sas_address = 0; 1253 u64 sas_address = 0;
1219 1254
1220 if (!rsp) { 1255 if (!rsp) {
1221 printk(KERN_ERR "%s: the smp response space is missing\n", 1256 printk(MYIOC_s_ERR_FMT "%s: the smp response space is missing\n",
1222 __FUNCTION__); 1257 ioc->name, __FUNCTION__);
1223 return -EINVAL; 1258 return -EINVAL;
1224 } 1259 }
1225 1260
1226 /* do we need to support multiple segments? */ 1261 /* do we need to support multiple segments? */
1227 if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) { 1262 if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) {
1228 printk(KERN_ERR "%s: multiple segments req %u %u, rsp %u %u\n", 1263 printk(MYIOC_s_ERR_FMT "%s: multiple segments req %u %u, rsp %u %u\n",
1229 __FUNCTION__, req->bio->bi_vcnt, req->data_len, 1264 ioc->name, __FUNCTION__, req->bio->bi_vcnt, req->data_len,
1230 rsp->bio->bi_vcnt, rsp->data_len); 1265 rsp->bio->bi_vcnt, rsp->data_len);
1231 return -EINVAL; 1266 return -EINVAL;
1232 } 1267 }
1233 1268
@@ -1292,7 +1327,7 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1292 1327
1293 timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ); 1328 timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ);
1294 if (!timeleft) { 1329 if (!timeleft) {
1295 printk(KERN_ERR "%s: smp timeout!\n", __FUNCTION__); 1330 printk(MYIOC_s_ERR_FMT "%s: smp timeout!\n", ioc->name, __FUNCTION__);
1296 /* On timeout reset the board */ 1331 /* On timeout reset the board */
1297 mpt_HardResetHandler(ioc, CAN_SLEEP); 1332 mpt_HardResetHandler(ioc, CAN_SLEEP);
1298 ret = -ETIMEDOUT; 1333 ret = -ETIMEDOUT;
@@ -1307,8 +1342,8 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1307 memcpy(req->sense, smprep, sizeof(*smprep)); 1342 memcpy(req->sense, smprep, sizeof(*smprep));
1308 req->sense_len = sizeof(*smprep); 1343 req->sense_len = sizeof(*smprep);
1309 } else { 1344 } else {
1310 printk(KERN_ERR "%s: smp passthru reply failed to be returned\n", 1345 printk(MYIOC_s_ERR_FMT "%s: smp passthru reply failed to be returned\n",
1311 __FUNCTION__); 1346 ioc->name, __FUNCTION__);
1312 ret = -ENXIO; 1347 ret = -ENXIO;
1313 } 1348 }
1314unmap: 1349unmap:
@@ -1952,12 +1987,12 @@ static int mptsas_probe_one_phy(struct device *dev,
1952 goto out; 1987 goto out;
1953 } 1988 }
1954 mptsas_set_port(ioc, phy_info, port); 1989 mptsas_set_port(ioc, phy_info, port);
1955 dsaswideprintk(ioc, printk(KERN_DEBUG 1990 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT
1956 "sas_port_alloc: port=%p dev=%p port_id=%d\n", 1991 "sas_port_alloc: port=%p dev=%p port_id=%d\n",
1957 port, dev, port->port_identifier)); 1992 ioc->name, port, dev, port->port_identifier));
1958 } 1993 }
1959 dsaswideprintk(ioc, printk(KERN_DEBUG "sas_port_add_phy: phy_id=%d\n", 1994 dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "sas_port_add_phy: phy_id=%d\n",
1960 phy_info->phy_id)); 1995 ioc->name, phy_info->phy_id));
1961 sas_port_add_phy(port, phy_info->phy); 1996 sas_port_add_phy(port, phy_info->phy);
1962 phy_info->sas_port_add_phy = 0; 1997 phy_info->sas_port_add_phy = 0;
1963 } 1998 }
@@ -2259,8 +2294,8 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc)
2259 expander_sas_address) 2294 expander_sas_address)
2260 continue; 2295 continue;
2261 dsaswideprintk(ioc, 2296 dsaswideprintk(ioc,
2262 dev_printk(KERN_DEBUG, &port->dev, 2297 dev_printk(MYIOC_s_DEBUG_FMT, &port->dev,
2263 "delete port (%d)\n", port->port_identifier)); 2298 "delete port (%d)\n", ioc->name, port->port_identifier));
2264 sas_port_delete(port); 2299 sas_port_delete(port);
2265 mptsas_port_delete(ioc, phy_info->port_details); 2300 mptsas_port_delete(ioc, phy_info->port_details);
2266 } 2301 }
@@ -2503,7 +2538,7 @@ mptsas_adding_inactive_raid_components(MPT_ADAPTER *ioc, u8 channel, u8 id)
2503 2538
2504 ev = kzalloc(sizeof(*ev), GFP_ATOMIC); 2539 ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
2505 if (!ev) { 2540 if (!ev) {
2506 printk(KERN_WARNING "mptsas: lost hotplug event\n"); 2541 printk(MYIOC_s_WARN_FMT "mptsas: lost hotplug event\n", ioc->name);
2507 goto out; 2542 goto out;
2508 } 2543 }
2509 2544
@@ -2644,8 +2679,8 @@ mptsas_hotplug_work(struct work_struct *work)
2644 printk(MYIOC_s_INFO_FMT 2679 printk(MYIOC_s_INFO_FMT
2645 "removing %s device, channel %d, id %d, phy %d\n", 2680 "removing %s device, channel %d, id %d, phy %d\n",
2646 ioc->name, ds, ev->channel, ev->id, phy_info->phy_id); 2681 ioc->name, ds, ev->channel, ev->id, phy_info->phy_id);
2647 dev_printk(KERN_DEBUG, &port->dev, 2682 dev_printk(MYIOC_s_DEBUG_FMT, &port->dev,
2648 "delete port (%d)\n", port->port_identifier); 2683 "delete port (%d)\n", ioc->name, port->port_identifier);
2649 sas_port_delete(port); 2684 sas_port_delete(port);
2650 mptsas_port_delete(ioc, phy_info->port_details); 2685 mptsas_port_delete(ioc, phy_info->port_details);
2651 break; 2686 break;
@@ -2686,8 +2721,8 @@ mptsas_hotplug_work(struct work_struct *work)
2686 2721
2687 if (!vtarget) { 2722 if (!vtarget) {
2688 dfailprintk(ioc, printk(MYIOC_s_ERR_FMT 2723 dfailprintk(ioc, printk(MYIOC_s_ERR_FMT
2689 "%s: exit at line=%d\n", ioc->name, 2724 "%s: exit at line=%d\n", ioc->name,
2690 __FUNCTION__, __LINE__)); 2725 __FUNCTION__, __LINE__));
2691 break; 2726 break;
2692 } 2727 }
2693 /* 2728 /*
@@ -2820,7 +2855,7 @@ mptsas_send_sas_event(MPT_ADAPTER *ioc,
2820 case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: 2855 case MPI_EVENT_SAS_DEV_STAT_RC_ADDED:
2821 ev = kzalloc(sizeof(*ev), GFP_ATOMIC); 2856 ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
2822 if (!ev) { 2857 if (!ev) {
2823 printk(KERN_WARNING "mptsas: lost hotplug event\n"); 2858 printk(MYIOC_s_WARN_FMT "lost hotplug event\n", ioc->name);
2824 break; 2859 break;
2825 } 2860 }
2826 2861
@@ -2879,7 +2914,7 @@ mptsas_send_raid_event(MPT_ADAPTER *ioc,
2879 2914
2880 ev = kzalloc(sizeof(*ev), GFP_ATOMIC); 2915 ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
2881 if (!ev) { 2916 if (!ev) {
2882 printk(KERN_WARNING "mptsas: lost hotplug event\n"); 2917 printk(MYIOC_s_WARN_FMT "lost hotplug event\n", ioc->name);
2883 return; 2918 return;
2884 } 2919 }
2885 2920
@@ -3230,8 +3265,8 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
3230 3265
3231 error = scsi_add_host(sh, &ioc->pcidev->dev); 3266 error = scsi_add_host(sh, &ioc->pcidev->dev);
3232 if (error) { 3267 if (error) {
3233 dprintk(ioc, printk(KERN_ERR MYNAM 3268 dprintk(ioc, printk(MYIOC_s_ERR_FMT
3234 "scsi_add_host failed\n")); 3269 "scsi_add_host failed\n", ioc->name));
3235 goto out_mptsas_probe; 3270 goto out_mptsas_probe;
3236 } 3271 }
3237 3272
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index f00c1003a765..8081fe70b190 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -192,7 +192,7 @@ mptscsih_getFreeChainBuffer(MPT_ADAPTER *ioc, int *retIndex)
192 int chain_idx; 192 int chain_idx;
193 193
194 dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "getFreeChainBuffer called\n", 194 dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "getFreeChainBuffer called\n",
195 ioc->name)); 195 ioc->name));
196 spin_lock_irqsave(&ioc->FreeQlock, flags); 196 spin_lock_irqsave(&ioc->FreeQlock, flags);
197 if (!list_empty(&ioc->FreeChainQ)) { 197 if (!list_empty(&ioc->FreeChainQ)) {
198 int offset; 198 int offset;
@@ -203,13 +203,14 @@ mptscsih_getFreeChainBuffer(MPT_ADAPTER *ioc, int *retIndex)
203 offset = (u8 *)chainBuf - (u8 *)ioc->ChainBuffer; 203 offset = (u8 *)chainBuf - (u8 *)ioc->ChainBuffer;
204 chain_idx = offset / ioc->req_sz; 204 chain_idx = offset / ioc->req_sz;
205 rc = SUCCESS; 205 rc = SUCCESS;
206 dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "getFreeChainBuffer chainBuf=%p ChainBuffer=%p offset=%d chain_idx=%d\n", 206 dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT
207 ioc->name, chainBuf, ioc->ChainBuffer, offset, chain_idx)); 207 "getFreeChainBuffer chainBuf=%p ChainBuffer=%p offset=%d chain_idx=%d\n",
208 ioc->name, chainBuf, ioc->ChainBuffer, offset, chain_idx));
208 } else { 209 } else {
209 rc = FAILED; 210 rc = FAILED;
210 chain_idx = MPT_HOST_NO_CHAIN; 211 chain_idx = MPT_HOST_NO_CHAIN;
211 dfailprintk(ioc, printk(MYIOC_s_DEBUG_FMT "getFreeChainBuffer failed\n", 212 dfailprintk(ioc, printk(MYIOC_s_ERR_FMT "getFreeChainBuffer failed\n",
212 ioc->name)); 213 ioc->name));
213 } 214 }
214 spin_unlock_irqrestore(&ioc->FreeQlock, flags); 215 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
215 216
@@ -419,8 +420,8 @@ nextSGEset:
419 * out the Address and Flags fields. 420 * out the Address and Flags fields.
420 */ 421 */
421 chainSge = (char *) psge; 422 chainSge = (char *) psge;
422 dsgprintk(ioc, printk(KERN_DEBUG " Current buff @ %p (index 0x%x)", 423 dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT " Current buff @ %p (index 0x%x)",
423 psge, req_idx)); 424 ioc->name, psge, req_idx));
424 425
425 /* Start the SGE for the next buffer 426 /* Start the SGE for the next buffer
426 */ 427 */
@@ -428,8 +429,8 @@ nextSGEset:
428 sgeOffset = 0; 429 sgeOffset = 0;
429 sg_done = 0; 430 sg_done = 0;
430 431
431 dsgprintk(ioc, printk(KERN_DEBUG " Chain buff @ %p (index 0x%x)\n", 432 dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT " Chain buff @ %p (index 0x%x)\n",
432 psge, chain_idx)); 433 ioc->name, psge, chain_idx));
433 434
434 /* Start the SGE for the next buffer 435 /* Start the SGE for the next buffer
435 */ 436 */
@@ -588,18 +589,17 @@ mptscsih_info_scsiio(MPT_ADAPTER *ioc, struct scsi_cmnd *sc, SCSIIOReply_t * pSc
588 } 589 }
589 590
590 scsi_print_command(sc); 591 scsi_print_command(sc);
591 printk(KERN_DEBUG "\tfw_channel = %d, fw_id = %d\n", 592 printk(MYIOC_s_DEBUG_FMT "\tfw_channel = %d, fw_id = %d\n",
592 pScsiReply->Bus, pScsiReply->TargetID); 593 ioc->name, pScsiReply->Bus, pScsiReply->TargetID);
593 printk(KERN_DEBUG "\trequest_len = %d, underflow = %d, resid = %d\n", 594 printk(MYIOC_s_DEBUG_FMT "\trequest_len = %d, underflow = %d, "
594 scsi_bufflen(sc), sc->underflow, scsi_get_resid(sc)); 595 "resid = %d\n", ioc->name, scsi_bufflen(sc), sc->underflow,
595 printk(KERN_DEBUG "\ttag = %d, transfer_count = %d, sc->result = %08X\n", 596 scsi_get_resid(sc));
596 le16_to_cpu(pScsiReply->TaskTag), 597 printk(MYIOC_s_DEBUG_FMT "\ttag = %d, transfer_count = %d, "
598 "sc->result = %08X\n", ioc->name, le16_to_cpu(pScsiReply->TaskTag),
597 le32_to_cpu(pScsiReply->TransferCount), sc->result); 599 le32_to_cpu(pScsiReply->TransferCount), sc->result);
598 600 printk(MYIOC_s_DEBUG_FMT "\tiocstatus = %s (0x%04x), "
599 printk(KERN_DEBUG "\tiocstatus = %s (0x%04x), "
600 "scsi_status = %s (0x%02x), scsi_state = (0x%02x)\n", 601 "scsi_status = %s (0x%02x), scsi_state = (0x%02x)\n",
601 desc, ioc_status, 602 ioc->name, desc, ioc_status, desc1, pScsiReply->SCSIStatus,
602 desc1, pScsiReply->SCSIStatus,
603 pScsiReply->SCSIState); 603 pScsiReply->SCSIState);
604 604
605 if (pScsiReply->SCSIState & MPI_SCSI_STATE_AUTOSENSE_VALID) { 605 if (pScsiReply->SCSIState & MPI_SCSI_STATE_AUTOSENSE_VALID) {
@@ -607,9 +607,8 @@ mptscsih_info_scsiio(MPT_ADAPTER *ioc, struct scsi_cmnd *sc, SCSIIOReply_t * pSc
607 asc = sc->sense_buffer[12]; 607 asc = sc->sense_buffer[12];
608 ascq = sc->sense_buffer[13]; 608 ascq = sc->sense_buffer[13];
609 609
610 printk(KERN_DEBUG "\t[sense_key,asc,ascq]: " 610 printk(MYIOC_s_DEBUG_FMT "\t[sense_key,asc,ascq]: "
611 "[0x%02x,0x%02x,0x%02x]\n", 611 "[0x%02x,0x%02x,0x%02x]\n", ioc->name, skey, asc, ascq);
612 skey, asc, ascq);
613 } 612 }
614 613
615 /* 614 /*
@@ -617,8 +616,8 @@ mptscsih_info_scsiio(MPT_ADAPTER *ioc, struct scsi_cmnd *sc, SCSIIOReply_t * pSc
617 */ 616 */
618 if (pScsiReply->SCSIState & MPI_SCSI_STATE_RESPONSE_INFO_VALID && 617 if (pScsiReply->SCSIState & MPI_SCSI_STATE_RESPONSE_INFO_VALID &&
619 pScsiReply->ResponseInfo) 618 pScsiReply->ResponseInfo)
620 printk(KERN_DEBUG "response_info = %08xh\n", 619 printk(MYIOC_s_DEBUG_FMT "response_info = %08xh\n",
621 le32_to_cpu(pScsiReply->ResponseInfo)); 620 ioc->name, le32_to_cpu(pScsiReply->ResponseInfo));
622} 621}
623#endif 622#endif
624 623
@@ -738,8 +737,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
738 */ 737 */
739 if (scsi_state & MPI_SCSI_STATE_RESPONSE_INFO_VALID && 738 if (scsi_state & MPI_SCSI_STATE_RESPONSE_INFO_VALID &&
740 pScsiReply->ResponseInfo) { 739 pScsiReply->ResponseInfo) {
741 printk(KERN_NOTICE "[%d:%d:%d:%d] " 740 printk(MYIOC_s_NOTE_FMT "[%d:%d:%d:%d] "
742 "FCP_ResponseInfo=%08xh\n", 741 "FCP_ResponseInfo=%08xh\n", ioc->name,
743 sc->device->host->host_no, sc->device->channel, 742 sc->device->host->host_no, sc->device->channel,
744 sc->device->id, sc->device->lun, 743 sc->device->id, sc->device->lun,
745 le32_to_cpu(pScsiReply->ResponseInfo)); 744 le32_to_cpu(pScsiReply->ResponseInfo));
@@ -824,9 +823,9 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
824 sc->result=DID_SOFT_ERROR << 16; 823 sc->result=DID_SOFT_ERROR << 16;
825 else /* Sufficient data transfer occurred */ 824 else /* Sufficient data transfer occurred */
826 sc->result = (DID_OK << 16) | scsi_status; 825 sc->result = (DID_OK << 16) | scsi_status;
827 dreplyprintk(ioc, printk(KERN_DEBUG 826 dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT
828 "RESIDUAL_MISMATCH: result=%x on channel=%d id=%d\n", 827 "RESIDUAL_MISMATCH: result=%x on channel=%d id=%d\n",
829 sc->result, sc->device->channel, sc->device->id)); 828 ioc->name, sc->result, sc->device->channel, sc->device->id));
830 break; 829 break;
831 830
832 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ 831 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */
@@ -858,9 +857,11 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
858 } 857 }
859 858
860 859
861 dreplyprintk(ioc, printk(KERN_DEBUG " sc->underflow={report ERR if < %02xh bytes xfer'd}\n", 860 dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT
862 sc->underflow)); 861 " sc->underflow={report ERR if < %02xh bytes xfer'd}\n",
863 dreplyprintk(ioc, printk(KERN_DEBUG " ActBytesXferd=%02xh\n", xfer_cnt)); 862 ioc->name, sc->underflow));
863 dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT
864 " ActBytesXferd=%02xh\n", ioc->name, xfer_cnt));
864 865
865 /* Report Queue Full 866 /* Report Queue Full
866 */ 867 */
@@ -974,7 +975,7 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
974 int ii; 975 int ii;
975 int max = ioc->req_depth; 976 int max = ioc->req_depth;
976 977
977 dprintk(ioc, printk(KERN_DEBUG MYNAM ": flush_ScsiLookup called\n")); 978 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": flush_ScsiLookup called\n", ioc->name));
978 for (ii= 0; ii < max; ii++) { 979 for (ii= 0; ii < max; ii++) {
979 if ((SCpnt = hd->ScsiLookup[ii]) != NULL) { 980 if ((SCpnt = hd->ScsiLookup[ii]) != NULL) {
980 981
@@ -986,8 +987,8 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
986 hd->ScsiLookup[ii] = NULL; 987 hd->ScsiLookup[ii] = NULL;
987 988
988 mf = MPT_INDEX_2_MFPTR(ioc, ii); 989 mf = MPT_INDEX_2_MFPTR(ioc, ii);
989 dmfprintk(ioc, printk(KERN_DEBUG MYNAM ": flush: ScsiDone (mf=%p,sc=%p)\n", 990 dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": flush: ScsiDone (mf=%p,sc=%p)\n",
990 mf, SCpnt)); 991 ioc->name, mf, SCpnt));
991 992
992 /* Free Chain buffers */ 993 /* Free Chain buffers */
993 mptscsih_freeChainBuffers(ioc, ii); 994 mptscsih_freeChainBuffers(ioc, ii);
@@ -1036,8 +1037,8 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
1036 struct scsi_cmnd *sc; 1037 struct scsi_cmnd *sc;
1037 struct scsi_lun lun; 1038 struct scsi_lun lun;
1038 1039
1039 dsprintk(hd->ioc, printk(KERN_DEBUG MYNAM ": search_running channel %d id %d lun %d max %d\n", 1040 dsprintk(hd->ioc, printk(MYIOC_s_DEBUG_FMT ": search_running channel %d id %d lun %d max %d\n",
1040 vdevice->vtarget->channel, vdevice->vtarget->id, vdevice->lun, max)); 1041 hd->ioc->name, vdevice->vtarget->channel, vdevice->vtarget->id, vdevice->lun, max));
1041 1042
1042 for (ii=0; ii < max; ii++) { 1043 for (ii=0; ii < max; ii++) {
1043 if ((sc = hd->ScsiLookup[ii]) != NULL) { 1044 if ((sc = hd->ScsiLookup[ii]) != NULL) {
@@ -1069,8 +1070,8 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
1069 scsi_dma_unmap(sc); 1070 scsi_dma_unmap(sc);
1070 sc->host_scribble = NULL; 1071 sc->host_scribble = NULL;
1071 sc->result = DID_NO_CONNECT << 16; 1072 sc->result = DID_NO_CONNECT << 16;
1072 sdev_printk(KERN_INFO, sc->device, "completing cmds: fw_channel %d," 1073 sdev_printk(MYIOC_s_INFO_FMT, sc->device, "completing cmds: fw_channel %d,"
1073 "fw_id %d, sc=%p, mf = %p, idx=%x\n", vdevice->vtarget->channel, 1074 "fw_id %d, sc=%p, mf = %p, idx=%x\n", hd->ioc->name, vdevice->vtarget->channel,
1074 vdevice->vtarget->id, sc, mf, ii); 1075 vdevice->vtarget->id, sc, mf, ii);
1075 sc->scsi_done(sc); 1076 sc->scsi_done(sc);
1076 } 1077 }
@@ -1475,7 +1476,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1475 mpt_put_msg_frame(hd->ioc->DoneCtx, hd->ioc, mf); 1476 mpt_put_msg_frame(hd->ioc->DoneCtx, hd->ioc, mf);
1476 dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n", 1477 dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n",
1477 ioc->name, SCpnt, mf, my_idx)); 1478 ioc->name, SCpnt, mf, my_idx));
1478 DBG_DUMP_REQUEST_FRAME(ioc, (u32 *)mf) 1479 DBG_DUMP_REQUEST_FRAME(ioc, (u32 *)mf);
1479 return 0; 1480 return 0;
1480 1481
1481 fail: 1482 fail:
@@ -1590,18 +1591,18 @@ mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int c
1590 */ 1591 */
1591 if (mptscsih_tm_pending_wait(hd) == FAILED) { 1592 if (mptscsih_tm_pending_wait(hd) == FAILED) {
1592 if (type == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK) { 1593 if (type == MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK) {
1593 dtmprintk(ioc, printk(KERN_DEBUG MYNAM ": %s: TMHandler abort: " 1594 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "TMHandler abort: "
1594 "Timed out waiting for last TM (%d) to complete! \n", 1595 "Timed out waiting for last TM (%d) to complete! \n",
1595 ioc->name, hd->tmPending)); 1596 ioc->name, hd->tmPending));
1596 return FAILED; 1597 return FAILED;
1597 } else if (type == MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET) { 1598 } else if (type == MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET) {
1598 dtmprintk(ioc, printk(KERN_DEBUG MYNAM ": %s: TMHandler target " 1599 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "TMHandler target "
1599 "reset: Timed out waiting for last TM (%d) " 1600 "reset: Timed out waiting for last TM (%d) "
1600 "to complete! \n", ioc->name, 1601 "to complete! \n", ioc->name,
1601 hd->tmPending)); 1602 hd->tmPending));
1602 return FAILED; 1603 return FAILED;
1603 } else if (type == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS) { 1604 } else if (type == MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS) {
1604 dtmprintk(ioc, printk(KERN_DEBUG MYNAM ": %s: TMHandler bus reset: " 1605 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "TMHandler bus reset: "
1605 "Timed out waiting for last TM (%d) to complete! \n", 1606 "Timed out waiting for last TM (%d) to complete! \n",
1606 ioc->name, hd->tmPending)); 1607 ioc->name, hd->tmPending));
1607 return FAILED; 1608 return FAILED;
@@ -1618,10 +1619,10 @@ mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int c
1618 printk(MYIOC_s_WARN_FMT 1619 printk(MYIOC_s_WARN_FMT
1619 "TM Handler for type=%x: IOC Not operational (0x%x)!\n", 1620 "TM Handler for type=%x: IOC Not operational (0x%x)!\n",
1620 ioc->name, type, ioc_raw_state); 1621 ioc->name, type, ioc_raw_state);
1621 printk(KERN_WARNING " Issuing HardReset!!\n"); 1622 printk(MYIOC_s_WARN_FMT " Issuing HardReset!!\n", ioc->name);
1622 if (mpt_HardResetHandler(ioc, CAN_SLEEP) < 0) 1623 if (mpt_HardResetHandler(ioc, CAN_SLEEP) < 0)
1623 printk((KERN_WARNING "TMHandler: HardReset " 1624 printk(MYIOC_s_WARN_FMT "TMHandler: HardReset "
1624 "FAILED!!\n")); 1625 "FAILED!!\n", ioc->name);
1625 return FAILED; 1626 return FAILED;
1626 } 1627 }
1627 1628
@@ -1806,8 +1807,8 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1806 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL) { 1807 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL) {
1807 SCpnt->result = DID_RESET << 16; 1808 SCpnt->result = DID_RESET << 16;
1808 SCpnt->scsi_done(SCpnt); 1809 SCpnt->scsi_done(SCpnt);
1809 printk(KERN_DEBUG MYNAM ": mptscsih_abort: Can't locate " 1810 printk(KERN_ERR MYNAM ": task abort: "
1810 "host! (sc=%p)\n", SCpnt); 1811 "can't locate host! (sc=%p)\n", SCpnt);
1811 return FAILED; 1812 return FAILED;
1812 } 1813 }
1813 1814
@@ -1818,8 +1819,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1818 1819
1819 vdevice = SCpnt->device->hostdata; 1820 vdevice = SCpnt->device->hostdata;
1820 if (!vdevice || !vdevice->vtarget) { 1821 if (!vdevice || !vdevice->vtarget) {
1821 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "task abort: device has been " 1822 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT
1822 "deleted (sc=%p)\n", ioc->name, SCpnt)); 1823 "task abort: device has been deleted (sc=%p)\n",
1824 ioc->name, SCpnt));
1823 SCpnt->result = DID_NO_CONNECT << 16; 1825 SCpnt->result = DID_NO_CONNECT << 16;
1824 SCpnt->scsi_done(SCpnt); 1826 SCpnt->scsi_done(SCpnt);
1825 retval = 0; 1827 retval = 0;
@@ -1829,8 +1831,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1829 /* Task aborts are not supported for hidden raid components. 1831 /* Task aborts are not supported for hidden raid components.
1830 */ 1832 */
1831 if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) { 1833 if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) {
1832 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "task abort: hidden raid " 1834 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT
1833 "component (sc=%p)\n", ioc->name, SCpnt)); 1835 "task abort: hidden raid component (sc=%p)\n",
1836 ioc->name, SCpnt));
1834 SCpnt->result = DID_RESET << 16; 1837 SCpnt->result = DID_RESET << 16;
1835 retval = FAILED; 1838 retval = FAILED;
1836 goto out; 1839 goto out;
@@ -1843,7 +1846,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1843 * Do OS callback. 1846 * Do OS callback.
1844 */ 1847 */
1845 SCpnt->result = DID_RESET << 16; 1848 SCpnt->result = DID_RESET << 16;
1846 dtmprintk(ioc, printk(KERN_DEBUG MYNAM ": %s: mptscsih_abort: " 1849 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "task abort: "
1847 "Command not in the active list! (sc=%p)\n", ioc->name, 1850 "Command not in the active list! (sc=%p)\n", ioc->name,
1848 SCpnt)); 1851 SCpnt));
1849 retval = 0; 1852 retval = 0;
@@ -1908,8 +1911,8 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
1908 /* If we can't locate our host adapter structure, return FAILED status. 1911 /* If we can't locate our host adapter structure, return FAILED status.
1909 */ 1912 */
1910 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){ 1913 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){
1911 printk(KERN_DEBUG MYNAM ": mptscsih_dev_reset: Can't " 1914 printk(KERN_ERR MYNAM ": target reset: "
1912 "locate host! (sc=%p)\n", SCpnt); 1915 "Can't locate host! (sc=%p)\n", SCpnt);
1913 return FAILED; 1916 return FAILED;
1914 } 1917 }
1915 1918
@@ -1971,8 +1974,8 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
1971 /* If we can't locate our host adapter structure, return FAILED status. 1974 /* If we can't locate our host adapter structure, return FAILED status.
1972 */ 1975 */
1973 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){ 1976 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){
1974 printk(KERN_DEBUG MYNAM ": mptscsih_bus_reset: Can't " 1977 printk(KERN_ERR MYNAM ": bus reset: "
1975 "locate host! (sc=%p)\n", SCpnt ); 1978 "Can't locate host! (sc=%p)\n", SCpnt);
1976 return FAILED; 1979 return FAILED;
1977 } 1980 }
1978 1981
@@ -2015,8 +2018,8 @@ mptscsih_host_reset(struct scsi_cmnd *SCpnt)
2015 2018
2016 /* If we can't locate the host to reset, then we failed. */ 2019 /* If we can't locate the host to reset, then we failed. */
2017 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){ 2020 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){
2018 printk( KERN_DEBUG MYNAM ": mptscsih_host_reset: Can't " 2021 printk(KERN_ERR MYNAM ": host reset: "
2019 "locate host! (sc=%p)\n", SCpnt); 2022 "Can't locate host! (sc=%p)\n", SCpnt);
2020 return FAILED; 2023 return FAILED;
2021 } 2024 }
2022 2025
@@ -2229,7 +2232,7 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m
2229 if (iocstatus == MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED || 2232 if (iocstatus == MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED ||
2230 hd->cmdPtr) 2233 hd->cmdPtr)
2231 if (mpt_HardResetHandler(ioc, NO_SLEEP) < 0) 2234 if (mpt_HardResetHandler(ioc, NO_SLEEP) < 0)
2232 printk((KERN_WARNING " Firmware Reload FAILED!!\n")); 2235 printk(MYIOC_s_WARN_FMT " Firmware Reload FAILED!!\n", ioc->name);
2233 break; 2236 break;
2234 2237
2235 case MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET: 2238 case MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET:
@@ -2576,10 +2579,10 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
2576 unsigned long flags; 2579 unsigned long flags;
2577 int ii; 2580 int ii;
2578 2581
2579 dtmprintk(ioc, printk(KERN_DEBUG MYNAM 2582 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT
2580 ": IOC %s_reset routed to SCSI host driver!\n", 2583 ": IOC %s_reset routed to SCSI host driver!\n",
2581 reset_phase==MPT_IOC_SETUP_RESET ? "setup" : ( 2584 ioc->name, reset_phase==MPT_IOC_SETUP_RESET ? "setup" : (
2582 reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post"))); 2585 reset_phase==MPT_IOC_PRE_RESET ? "pre" : "post")));
2583 2586
2584 /* If a FW reload request arrives after base installed but 2587 /* If a FW reload request arrives after base installed but
2585 * before all scsi hosts have been attached, then an alt_ioc 2588 * before all scsi hosts have been attached, then an alt_ioc
@@ -2719,7 +2722,8 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
2719 case MPI_EVENT_STATE_CHANGE: /* 02 */ 2722 case MPI_EVENT_STATE_CHANGE: /* 02 */
2720 case MPI_EVENT_EVENT_CHANGE: /* 0A */ 2723 case MPI_EVENT_EVENT_CHANGE: /* 0A */
2721 default: 2724 default:
2722 dprintk(ioc, printk(KERN_DEBUG MYNAM ": Ignoring event (=%02Xh)\n", event)); 2725 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": Ignoring event (=%02Xh)\n",
2726 ioc->name, event));
2723 break; 2727 break;
2724 } 2728 }
2725 2729
@@ -2852,8 +2856,8 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
2852 SCSI_STD_SENSE_BYTES); 2856 SCSI_STD_SENSE_BYTES);
2853 memcpy(hd->pLocal->sense, sense_data, sz); 2857 memcpy(hd->pLocal->sense, sense_data, sz);
2854 2858
2855 ddvprintk(ioc, printk(KERN_DEBUG " Check Condition, sense ptr %p\n", 2859 ddvprintk(ioc, printk(MYIOC_s_DEBUG_FMT " Check Condition, sense ptr %p\n",
2856 sense_data)); 2860 ioc->name, sense_data));
2857 } else if (pReply->SCSIState & MPI_SCSI_STATE_AUTOSENSE_FAILED) { 2861 } else if (pReply->SCSIState & MPI_SCSI_STATE_AUTOSENSE_FAILED) {
2858 if (pReq->CDB[0] == INQUIRY) 2862 if (pReq->CDB[0] == INQUIRY)
2859 completionCode = MPT_SCANDV_ISSUE_SENSE; 2863 completionCode = MPT_SCANDV_ISSUE_SENSE;
@@ -3085,8 +3089,8 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
3085 /* Get and Populate a free Frame 3089 /* Get and Populate a free Frame
3086 */ 3090 */
3087 if ((mf = mpt_get_msg_frame(hd->ioc->InternalCtx, hd->ioc)) == NULL) { 3091 if ((mf = mpt_get_msg_frame(hd->ioc->InternalCtx, hd->ioc)) == NULL) {
3088 ddvprintk(hd->ioc, printk(MYIOC_s_DEBUG_FMT "No msg frames!\n", 3092 dfailprintk(hd->ioc, printk(MYIOC_s_WARN_FMT "No msg frames!\n",
3089 hd->ioc->name)); 3093 hd->ioc->name));
3090 return -EBUSY; 3094 return -EBUSY;
3091 } 3095 }
3092 3096
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 31087882d235..0e1cf5d60bd9 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -139,8 +139,9 @@ mptspi_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target,
139 factor = MPT_ULTRA320; 139 factor = MPT_ULTRA320;
140 if (scsi_device_qas(sdev)) { 140 if (scsi_device_qas(sdev)) {
141 ddvprintk(hd->ioc, 141 ddvprintk(hd->ioc,
142 printk(KERN_DEBUG "Enabling QAS due to " 142 printk(MYIOC_s_DEBUG_FMT "Enabling QAS due to "
143 "byte56=%02x on id=%d!\n", scsi_device_qas(sdev), id)); 143 "byte56=%02x on id=%d!\n", hd->ioc->name,
144 scsi_device_qas(sdev), id));
144 noQas = 0; 145 noQas = 0;
145 } 146 }
146 if (sdev->type == TYPE_TAPE && 147 if (sdev->type == TYPE_TAPE &&
@@ -227,8 +228,8 @@ mptspi_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target,
227 /* Disable QAS in a mixed configuration case 228 /* Disable QAS in a mixed configuration case
228 */ 229 */
229 230
230 ddvprintk(hd->ioc, printk(KERN_DEBUG 231 ddvprintk(hd->ioc, printk(MYIOC_s_DEBUG_FMT
231 "Disabling QAS due to noQas=%02x on id=%d!\n", noQas, id)); 232 "Disabling QAS due to noQas=%02x on id=%d!\n", hd->ioc->name, noQas, id));
232 } 233 }
233} 234}
234 235
@@ -302,7 +303,7 @@ mptspi_writeIOCPage4(MPT_SCSI_HOST *hd, u8 channel , u8 id)
302 303
303 ddvprintk(ioc, printk(MYIOC_s_DEBUG_FMT 304 ddvprintk(ioc, printk(MYIOC_s_DEBUG_FMT
304 "writeIOCPage4: MaxSEP=%d ActiveSEP=%d id=%d bus=%d\n", 305 "writeIOCPage4: MaxSEP=%d ActiveSEP=%d id=%d bus=%d\n",
305 ioc->name, IOCPage4Ptr->MaxSEP, IOCPage4Ptr->ActiveSEP, id, channel)); 306 ioc->name, IOCPage4Ptr->MaxSEP, IOCPage4Ptr->ActiveSEP, id, channel));
306 307
307 mpt_put_msg_frame(ioc->DoneCtx, ioc, mf); 308 mpt_put_msg_frame(ioc->DoneCtx, ioc, mf);
308 309
@@ -425,8 +426,8 @@ static int mptspi_target_alloc(struct scsi_target *starget)
425 if (starget->channel == 0 && 426 if (starget->channel == 0 &&
426 mptspi_is_raid(hd, starget->id)) { 427 mptspi_is_raid(hd, starget->id)) {
427 vtarget->raidVolume = 1; 428 vtarget->raidVolume = 1;
428 ddvprintk(hd->ioc, printk(KERN_DEBUG 429 ddvprintk(hd->ioc, printk(MYIOC_s_DEBUG_FMT
429 "RAID Volume @ channel=%d id=%d\n", starget->channel, 430 "RAID Volume @ channel=%d id=%d\n", hd->ioc->name, starget->channel,
430 starget->id)); 431 starget->id));
431 } 432 }
432 433
@@ -532,7 +533,8 @@ static int mptspi_read_spi_device_pg0(struct scsi_target *starget,
532 533
533 pg0 = dma_alloc_coherent(&ioc->pcidev->dev, size, &pg0_dma, GFP_KERNEL); 534 pg0 = dma_alloc_coherent(&ioc->pcidev->dev, size, &pg0_dma, GFP_KERNEL);
534 if (pg0 == NULL) { 535 if (pg0 == NULL) {
535 starget_printk(KERN_ERR, starget, "dma_alloc_coherent for parameters failed\n"); 536 starget_printk(MYIOC_s_ERR_FMT, starget,
537 "dma_alloc_coherent for parameters failed\n", ioc->name);
536 return -EINVAL; 538 return -EINVAL;
537 } 539 }
538 540
@@ -552,7 +554,7 @@ static int mptspi_read_spi_device_pg0(struct scsi_target *starget,
552 cfg.pageAddr = starget->id; 554 cfg.pageAddr = starget->id;
553 555
554 if (mpt_config(ioc, &cfg)) { 556 if (mpt_config(ioc, &cfg)) {
555 starget_printk(KERN_ERR, starget, "mpt_config failed\n"); 557 starget_printk(MYIOC_s_ERR_FMT, starget, "mpt_config failed\n", ioc->name);
556 goto out_free; 558 goto out_free;
557 } 559 }
558 err = 0; 560 err = 0;
@@ -673,8 +675,8 @@ static void mptspi_dv_device(struct _MPT_SCSI_HOST *hd,
673 /* If this is a piece of a RAID, then quiesce first */ 675 /* If this is a piece of a RAID, then quiesce first */
674 if (sdev->channel == 1 && 676 if (sdev->channel == 1 &&
675 mptscsih_quiesce_raid(hd, 1, vtarget->channel, vtarget->id) < 0) { 677 mptscsih_quiesce_raid(hd, 1, vtarget->channel, vtarget->id) < 0) {
676 starget_printk(KERN_ERR, scsi_target(sdev), 678 starget_printk(MYIOC_s_ERR_FMT, scsi_target(sdev),
677 "Integrated RAID quiesce failed\n"); 679 "Integrated RAID quiesce failed\n", hd->ioc->name);
678 return; 680 return;
679 } 681 }
680 682
@@ -684,8 +686,8 @@ static void mptspi_dv_device(struct _MPT_SCSI_HOST *hd,
684 686
685 if (sdev->channel == 1 && 687 if (sdev->channel == 1 &&
686 mptscsih_quiesce_raid(hd, 0, vtarget->channel, vtarget->id) < 0) 688 mptscsih_quiesce_raid(hd, 0, vtarget->channel, vtarget->id) < 0)
687 starget_printk(KERN_ERR, scsi_target(sdev), 689 starget_printk(MYIOC_s_ERR_FMT, scsi_target(sdev),
688 "Integrated RAID resume failed\n"); 690 "Integrated RAID resume failed\n", hd->ioc->name);
689 691
690 mptspi_read_parameters(sdev->sdev_target); 692 mptspi_read_parameters(sdev->sdev_target);
691 spi_display_xfer_agreement(sdev->sdev_target); 693 spi_display_xfer_agreement(sdev->sdev_target);
@@ -847,7 +849,8 @@ static int mptspi_write_spi_device_pg1(struct scsi_target *starget,
847 849
848 pg1 = dma_alloc_coherent(&ioc->pcidev->dev, size, &pg1_dma, GFP_KERNEL); 850 pg1 = dma_alloc_coherent(&ioc->pcidev->dev, size, &pg1_dma, GFP_KERNEL);
849 if (pg1 == NULL) { 851 if (pg1 == NULL) {
850 starget_printk(KERN_ERR, starget, "dma_alloc_coherent for parameters failed\n"); 852 starget_printk(MYIOC_s_ERR_FMT, starget,
853 "dma_alloc_coherent for parameters failed\n", ioc->name);
851 return -EINVAL; 854 return -EINVAL;
852 } 855 }
853 856
@@ -876,7 +879,8 @@ static int mptspi_write_spi_device_pg1(struct scsi_target *starget,
876 mptspi_print_write_nego(hd, starget, le32_to_cpu(pg1->RequestedParameters)); 879 mptspi_print_write_nego(hd, starget, le32_to_cpu(pg1->RequestedParameters));
877 880
878 if (mpt_config(ioc, &cfg)) { 881 if (mpt_config(ioc, &cfg)) {
879 starget_printk(KERN_ERR, starget, "mpt_config failed\n"); 882 starget_printk(MYIOC_s_ERR_FMT, starget,
883 "mpt_config failed\n", ioc->name);
880 goto out_free; 884 goto out_free;
881 } 885 }
882 err = 0; 886 err = 0;
@@ -1092,12 +1096,12 @@ static void mpt_work_wrapper(struct work_struct *work)
1092 if(vtarget->id != disk) 1096 if(vtarget->id != disk)
1093 continue; 1097 continue;
1094 1098
1095 starget_printk(KERN_INFO, vtarget->starget, 1099 starget_printk(MYIOC_s_INFO_FMT, vtarget->starget,
1096 "Integrated RAID requests DV of new device\n"); 1100 "Integrated RAID requests DV of new device\n", hd->ioc->name);
1097 mptspi_dv_device(hd, sdev); 1101 mptspi_dv_device(hd, sdev);
1098 } 1102 }
1099 shost_printk(KERN_INFO, shost, 1103 shost_printk(MYIOC_s_INFO_FMT, shost,
1100 "Integrated RAID detects new device %d\n", disk); 1104 "Integrated RAID detects new device %d\n", hd->ioc->name, disk);
1101 scsi_scan_target(&hd->ioc->sh->shost_gendev, 1, disk, 0, 1); 1105 scsi_scan_target(&hd->ioc->sh->shost_gendev, 1, disk, 0, 1);
1102} 1106}
1103 1107
@@ -1107,9 +1111,9 @@ static void mpt_dv_raid(struct _MPT_SCSI_HOST *hd, int disk)
1107 struct work_queue_wrapper *wqw = kmalloc(sizeof(*wqw), GFP_ATOMIC); 1111 struct work_queue_wrapper *wqw = kmalloc(sizeof(*wqw), GFP_ATOMIC);
1108 1112
1109 if (!wqw) { 1113 if (!wqw) {
1110 shost_printk(KERN_ERR, hd->ioc->sh, 1114 shost_printk(MYIOC_s_ERR_FMT, hd->ioc->sh,
1111 "Failed to act on RAID event for physical disk %d\n", 1115 "Failed to act on RAID event for physical disk %d\n",
1112 disk); 1116 hd->ioc->name, disk);
1113 return; 1117 return;
1114 } 1118 }
1115 INIT_WORK(&wqw->work, mpt_work_wrapper); 1119 INIT_WORK(&wqw->work, mpt_work_wrapper);
@@ -1418,7 +1422,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1418 1422
1419 if (numSGE < sh->sg_tablesize) { 1423 if (numSGE < sh->sg_tablesize) {
1420 /* Reset this value */ 1424 /* Reset this value */
1421 dprintk(ioc, printk(MYIOC_s_INFO_FMT 1425 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
1422 "Resetting sg_tablesize to %d from %d\n", 1426 "Resetting sg_tablesize to %d from %d\n",
1423 ioc->name, numSGE, sh->sg_tablesize)); 1427 ioc->name, numSGE, sh->sg_tablesize));
1424 sh->sg_tablesize = numSGE; 1428 sh->sg_tablesize = numSGE;
@@ -1484,8 +1488,8 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1484 1488
1485 error = scsi_add_host (sh, &ioc->pcidev->dev); 1489 error = scsi_add_host (sh, &ioc->pcidev->dev);
1486 if(error) { 1490 if(error) {
1487 dprintk(ioc, printk(KERN_ERR MYNAM 1491 dprintk(ioc, printk(MYIOC_s_ERR_FMT
1488 "scsi_add_host failed\n")); 1492 "scsi_add_host failed\n", ioc->name));
1489 goto out_mptspi_probe; 1493 goto out_mptspi_probe;
1490 } 1494 }
1491 1495