]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/message/fusion/mptbase.c
[SCSI] mpt fusion: fc loginfo using defines from the header
[linux-2.6-omap-h63xx.git] / drivers / message / fusion / mptbase.c
index 083acfd91d8bff0dad61188a8195c7b8aa1893e2..5a10c87239c22f0a57072d5b351859ad81236f4f 100644 (file)
@@ -6,7 +6,7 @@
  *      running LSI Logic Fusion MPT (Message Passing Technology) firmware.
  *
  *  Copyright (c) 1999-2007 LSI Logic Corporation
- *  (mailto:mpt_linux_developer@lsi.com)
+ *  (mailto:DL-MPTFusionLinux@lsi.com)
  *
  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -64,6 +64,7 @@
 #endif
 
 #include "mptbase.h"
+#include "lsi/mpi_log_fc.h"
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 #define my_NAME                "Fusion MPT base driver"
@@ -1531,6 +1532,7 @@ mpt_resume(struct pci_dev *pdev)
        MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
        u32 device_state = pdev->current_state;
        int recovery_state;
+       int err;
 
        printk(MYIOC_s_INFO_FMT
        "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
@@ -1538,7 +1540,9 @@ mpt_resume(struct pci_dev *pdev)
 
        pci_set_power_state(pdev, 0);
        pci_restore_state(pdev);
-       pci_enable_device(pdev);
+       err = pci_enable_device(pdev);
+       if (err)
+               return err;
 
        /* enable interrupts */
        CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM);
@@ -3582,7 +3586,7 @@ initChainBuffers(MPT_ADAPTER *ioc)
         * index = chain_idx
         *
         * Calculate the number of chain buffers needed(plus 1) per I/O
-        * then multiply the the maximum number of simultaneous cmds
+        * then multiply the maximum number of simultaneous cmds
         *
         * num_sge = num sge in request frame + last chain buffer
         * scale = num sge per chain buffer if no chain element
@@ -4739,12 +4743,8 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum)
 }
 
 /**
- * mpt_inactive_raid_list_free
- *
- * This clears this link list.
- *
- * @ioc - pointer to per adapter structure
- *
+ * mpt_inactive_raid_list_free - This clears this link list.
+ * @ioc : pointer to per adapter structure
  **/
 static void
 mpt_inactive_raid_list_free(MPT_ADAPTER *ioc)
@@ -4764,15 +4764,11 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc)
 }
 
 /**
- * mpt_inactive_raid_volumes
- *
- * This sets up link list of phy_disk_nums for devices belonging in an inactive volume
- *
- * @ioc - pointer to per adapter structure
- * @channel - volume channel
- * @id - volume target id
- *
+ * mpt_inactive_raid_volumes - sets up link list of phy_disk_nums for devices belonging in an inactive volume
  *
+ * @ioc : pointer to per adapter structure
+ * @channel : volume channel
+ * @id : volume target id
  **/
 static void
 mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
@@ -6354,14 +6350,37 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
 static void
 mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info)
 {
-       static char *subcl_str[8] = {
-               "FCP Initiator", "FCP Target", "LAN", "MPI Message Layer",
-               "FC Link", "Context Manager", "Invalid Field Offset", "State Change Info"
-       };
-       u8 subcl = (log_info >> 24) & 0x7;
+       char *desc = "unknown";
 
-       printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): SubCl={%s}\n",
-                       ioc->name, log_info, subcl_str[subcl]);
+       switch (log_info & 0xFF000000) {
+       case MPI_IOCLOGINFO_FC_INIT_BASE:
+               desc = "FCP Initiator";
+               break;
+       case MPI_IOCLOGINFO_FC_TARGET_BASE:
+               desc = "FCP Target";
+               break;
+       case MPI_IOCLOGINFO_FC_LAN_BASE:
+               desc = "LAN";
+               break;
+       case MPI_IOCLOGINFO_FC_MSG_BASE:
+               desc = "MPI Message Layer";
+               break;
+       case MPI_IOCLOGINFO_FC_LINK_BASE:
+               desc = "FC Link";
+               break;
+       case MPI_IOCLOGINFO_FC_CTX_BASE:
+               desc = "Context Manager";
+               break;
+       case MPI_IOCLOGINFO_FC_INVALID_FIELD_BYTE_OFFSET:
+               desc = "Invalid Field Offset";
+               break;
+       case MPI_IOCLOGINFO_FC_STATE_CHANGE:
+               desc = "State Change Info";
+               break;
+       }
+
+       printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): SubClass={%s}, Value=(0x%06x)\n",
+                       ioc->name, log_info, desc, (log_info & 0xFFFFFF));
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -6663,7 +6682,7 @@ union loginfo_type {
 /**
  *     mpt_iocstatus_info_config - IOCSTATUS information for config pages
  *     @ioc: Pointer to MPT_ADAPTER structure
- *     ioc_status: U32 IOCStatus word from IOC
+ *     @ioc_status: U32 IOCStatus word from IOC
  *     @mf: Pointer to MPT request frame
  *
  *     Refer to lsi/mpi.h.