diff options
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 875 |
1 files changed, 720 insertions, 155 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index b3f28a03b6a9..083acfd91d8b 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
7 | * | 7 | * |
8 | * Copyright (c) 1999-2007 LSI Logic Corporation | 8 | * Copyright (c) 1999-2007 LSI Logic Corporation |
9 | * (mailto:mpt_linux_developer@lsil.com) | 9 | * (mailto:mpt_linux_developer@lsi.com) |
10 | * | 10 | * |
11 | */ | 11 | */ |
12 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 12 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
@@ -82,6 +82,10 @@ static int mpt_msi_enable; | |||
82 | module_param(mpt_msi_enable, int, 0); | 82 | module_param(mpt_msi_enable, int, 0); |
83 | MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)"); | 83 | MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)"); |
84 | 84 | ||
85 | static int mpt_channel_mapping; | ||
86 | module_param(mpt_channel_mapping, int, 0); | ||
87 | MODULE_PARM_DESC(mpt_channel_mapping, " Mapping id's to channels (default=0)"); | ||
88 | |||
85 | #ifdef MFCNT | 89 | #ifdef MFCNT |
86 | static int mfcounter = 0; | 90 | static int mfcounter = 0; |
87 | #define PRINT_MF_COUNT 20000 | 91 | #define PRINT_MF_COUNT 20000 |
@@ -173,11 +177,14 @@ static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc); | |||
173 | 177 | ||
174 | //int mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag); | 178 | //int mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag); |
175 | static int ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply, int *evHandlers); | 179 | static int ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply, int *evHandlers); |
176 | static void mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf); | 180 | #ifdef MPT_DEBUG_REPLY |
181 | static void mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf); | ||
182 | #endif | ||
177 | static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); | 183 | static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); |
178 | static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info); | 184 | static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info); |
179 | static void mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info); | 185 | static void mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info); |
180 | static int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc); | 186 | static int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc); |
187 | static void mpt_inactive_raid_list_free(MPT_ADAPTER *ioc); | ||
181 | 188 | ||
182 | /* module entry point */ | 189 | /* module entry point */ |
183 | static int __init fusion_init (void); | 190 | static int __init fusion_init (void); |
@@ -319,13 +326,11 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa) | |||
319 | else if (ioc->bus_type == SAS) | 326 | else if (ioc->bus_type == SAS) |
320 | mpt_sas_log_info(ioc, log_info); | 327 | mpt_sas_log_info(ioc, log_info); |
321 | } | 328 | } |
322 | if (ioc_stat & MPI_IOCSTATUS_MASK) { | ||
323 | if (ioc->bus_type == SPI && | ||
324 | cb_idx != mpt_stm_index && | ||
325 | cb_idx != mpt_lan_index) | ||
326 | mpt_sp_ioc_info(ioc, (u32)ioc_stat, mf); | ||
327 | } | ||
328 | 329 | ||
330 | #ifdef MPT_DEBUG_REPLY | ||
331 | if (ioc_stat & MPI_IOCSTATUS_MASK) | ||
332 | mpt_iocstatus_info(ioc, (u32)ioc_stat, mf); | ||
333 | #endif | ||
329 | 334 | ||
330 | /* Check for (valid) IO callback! */ | 335 | /* Check for (valid) IO callback! */ |
331 | if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS || | 336 | if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS || |
@@ -911,7 +916,7 @@ mpt_add_sge(char *pAddr, u32 flagslength, dma_addr_t dma_addr) | |||
911 | int | 916 | int |
912 | mpt_send_handshake_request(int handle, MPT_ADAPTER *ioc, int reqBytes, u32 *req, int sleepFlag) | 917 | mpt_send_handshake_request(int handle, MPT_ADAPTER *ioc, int reqBytes, u32 *req, int sleepFlag) |
913 | { | 918 | { |
914 | int r = 0; | 919 | int r = 0; |
915 | u8 *req_as_bytes; | 920 | u8 *req_as_bytes; |
916 | int ii; | 921 | int ii; |
917 | 922 | ||
@@ -1811,6 +1816,13 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1811 | * and we try GetLanConfigPages again... | 1816 | * and we try GetLanConfigPages again... |
1812 | */ | 1817 | */ |
1813 | if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) { | 1818 | if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) { |
1819 | |||
1820 | /* | ||
1821 | * Initalize link list for inactive raid volumes. | ||
1822 | */ | ||
1823 | init_MUTEX(&ioc->raid_data.inactive_list_mutex); | ||
1824 | INIT_LIST_HEAD(&ioc->raid_data.inactive_list); | ||
1825 | |||
1814 | if (ioc->bus_type == SAS) { | 1826 | if (ioc->bus_type == SAS) { |
1815 | 1827 | ||
1816 | /* clear persistency table */ | 1828 | /* clear persistency table */ |
@@ -2017,6 +2029,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) | |||
2017 | } | 2029 | } |
2018 | 2030 | ||
2019 | kfree(ioc->spi_data.nvram); | 2031 | kfree(ioc->spi_data.nvram); |
2032 | mpt_inactive_raid_list_free(ioc); | ||
2033 | kfree(ioc->raid_data.pIocPg2); | ||
2020 | kfree(ioc->raid_data.pIocPg3); | 2034 | kfree(ioc->raid_data.pIocPg3); |
2021 | ioc->spi_data.nvram = NULL; | 2035 | ioc->spi_data.nvram = NULL; |
2022 | ioc->raid_data.pIocPg3 = NULL; | 2036 | ioc->raid_data.pIocPg3 = NULL; |
@@ -2413,6 +2427,9 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) | |||
2413 | facts->FWVersion.Word = le32_to_cpu(facts->FWVersion.Word); | 2427 | facts->FWVersion.Word = le32_to_cpu(facts->FWVersion.Word); |
2414 | 2428 | ||
2415 | facts->ProductID = le16_to_cpu(facts->ProductID); | 2429 | facts->ProductID = le16_to_cpu(facts->ProductID); |
2430 | if ((ioc->facts.ProductID & MPI_FW_HEADER_PID_PROD_MASK) | ||
2431 | > MPI_FW_HEADER_PID_PROD_TARGET_SCSI) | ||
2432 | ioc->ir_firmware = 1; | ||
2416 | facts->CurrentHostMfaHighAddr = | 2433 | facts->CurrentHostMfaHighAddr = |
2417 | le32_to_cpu(facts->CurrentHostMfaHighAddr); | 2434 | le32_to_cpu(facts->CurrentHostMfaHighAddr); |
2418 | facts->GlobalCredits = le16_to_cpu(facts->GlobalCredits); | 2435 | facts->GlobalCredits = le16_to_cpu(facts->GlobalCredits); |
@@ -2505,6 +2522,7 @@ GetPortFacts(MPT_ADAPTER *ioc, int portnum, int sleepFlag) | |||
2505 | int ii; | 2522 | int ii; |
2506 | int req_sz; | 2523 | int req_sz; |
2507 | int reply_sz; | 2524 | int reply_sz; |
2525 | int max_id; | ||
2508 | 2526 | ||
2509 | /* IOC *must* NOT be in RESET state! */ | 2527 | /* IOC *must* NOT be in RESET state! */ |
2510 | if (ioc->last_state == MPI_IOC_STATE_RESET) { | 2528 | if (ioc->last_state == MPI_IOC_STATE_RESET) { |
@@ -2552,6 +2570,21 @@ GetPortFacts(MPT_ADAPTER *ioc, int portnum, int sleepFlag) | |||
2552 | pfacts->MaxPersistentIDs = le16_to_cpu(pfacts->MaxPersistentIDs); | 2570 | pfacts->MaxPersistentIDs = le16_to_cpu(pfacts->MaxPersistentIDs); |
2553 | pfacts->MaxLanBuckets = le16_to_cpu(pfacts->MaxLanBuckets); | 2571 | pfacts->MaxLanBuckets = le16_to_cpu(pfacts->MaxLanBuckets); |
2554 | 2572 | ||
2573 | max_id = (ioc->bus_type == SAS) ? pfacts->PortSCSIID : | ||
2574 | pfacts->MaxDevices; | ||
2575 | ioc->devices_per_bus = (max_id > 255) ? 256 : max_id; | ||
2576 | ioc->number_of_buses = (ioc->devices_per_bus < 256) ? 1 : max_id/256; | ||
2577 | |||
2578 | /* | ||
2579 | * Place all the devices on channels | ||
2580 | * | ||
2581 | * (for debuging) | ||
2582 | */ | ||
2583 | if (mpt_channel_mapping) { | ||
2584 | ioc->devices_per_bus = 1; | ||
2585 | ioc->number_of_buses = (max_id > 255) ? 255 : max_id; | ||
2586 | } | ||
2587 | |||
2555 | return 0; | 2588 | return 0; |
2556 | } | 2589 | } |
2557 | 2590 | ||
@@ -2592,13 +2625,8 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) | |||
2592 | ddlprintk((MYIOC_s_INFO_FMT "upload_fw %d facts.Flags=%x\n", | 2625 | ddlprintk((MYIOC_s_INFO_FMT "upload_fw %d facts.Flags=%x\n", |
2593 | ioc->name, ioc->upload_fw, ioc->facts.Flags)); | 2626 | ioc->name, ioc->upload_fw, ioc->facts.Flags)); |
2594 | 2627 | ||
2595 | if(ioc->bus_type == SAS) | 2628 | ioc_init.MaxDevices = (U8)ioc->devices_per_bus; |
2596 | ioc_init.MaxDevices = ioc->facts.MaxDevices; | 2629 | ioc_init.MaxBuses = (U8)ioc->number_of_buses; |
2597 | else if(ioc->bus_type == FC) | ||
2598 | ioc_init.MaxDevices = MPT_MAX_FC_DEVICES; | ||
2599 | else | ||
2600 | ioc_init.MaxDevices = MPT_MAX_SCSI_DEVICES; | ||
2601 | ioc_init.MaxBuses = MPT_MAX_BUS; | ||
2602 | dinitprintk((MYIOC_s_INFO_FMT "facts.MsgVersion=%x\n", | 2630 | dinitprintk((MYIOC_s_INFO_FMT "facts.MsgVersion=%x\n", |
2603 | ioc->name, ioc->facts.MsgVersion)); | 2631 | ioc->name, ioc->facts.MsgVersion)); |
2604 | if (ioc->facts.MsgVersion >= MPI_VERSION_01_05) { | 2632 | if (ioc->facts.MsgVersion >= MPI_VERSION_01_05) { |
@@ -2720,9 +2748,7 @@ SendPortEnable(MPT_ADAPTER *ioc, int portnum, int sleepFlag) | |||
2720 | 2748 | ||
2721 | /* RAID FW may take a long time to enable | 2749 | /* RAID FW may take a long time to enable |
2722 | */ | 2750 | */ |
2723 | if (((ioc->facts.ProductID & MPI_FW_HEADER_PID_PROD_MASK) | 2751 | if (ioc->ir_firmware || ioc->bus_type == SAS) { |
2724 | > MPI_FW_HEADER_PID_PROD_TARGET_SCSI) || | ||
2725 | (ioc->bus_type == SAS)) { | ||
2726 | rc = mpt_handshake_req_reply_wait(ioc, req_sz, | 2752 | rc = mpt_handshake_req_reply_wait(ioc, req_sz, |
2727 | (u32*)&port_enable, reply_sz, (u16*)&reply_buf, | 2753 | (u32*)&port_enable, reply_sz, (u16*)&reply_buf, |
2728 | 300 /*seconds*/, sleepFlag); | 2754 | 300 /*seconds*/, sleepFlag); |
@@ -3193,6 +3219,9 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) | |||
3193 | u32 diag1val = 0; | 3219 | u32 diag1val = 0; |
3194 | #endif | 3220 | #endif |
3195 | 3221 | ||
3222 | /* Clear any existing interrupts */ | ||
3223 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); | ||
3224 | |||
3196 | if (ioc->pcidev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) { | 3225 | if (ioc->pcidev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) { |
3197 | drsprintk((MYIOC_s_WARN_FMT "%s: Doorbell=%p; 1078 reset " | 3226 | drsprintk((MYIOC_s_WARN_FMT "%s: Doorbell=%p; 1078 reset " |
3198 | "address=%p\n", ioc->name, __FUNCTION__, | 3227 | "address=%p\n", ioc->name, __FUNCTION__, |
@@ -3212,7 +3241,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) | |||
3212 | " count=%d\n", | 3241 | " count=%d\n", |
3213 | ioc->name, doorbell, count)); | 3242 | ioc->name, doorbell, count)); |
3214 | if (doorbell == MPI_IOC_STATE_READY) { | 3243 | if (doorbell == MPI_IOC_STATE_READY) { |
3215 | return 0; | 3244 | return 1; |
3216 | } | 3245 | } |
3217 | 3246 | ||
3218 | /* wait 1 sec */ | 3247 | /* wait 1 sec */ |
@@ -3224,9 +3253,6 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) | |||
3224 | return -1; | 3253 | return -1; |
3225 | } | 3254 | } |
3226 | 3255 | ||
3227 | /* Clear any existing interrupts */ | ||
3228 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); | ||
3229 | |||
3230 | /* Use "Diagnostic reset" method! (only thing available!) */ | 3256 | /* Use "Diagnostic reset" method! (only thing available!) */ |
3231 | diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); | 3257 | diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); |
3232 | 3258 | ||
@@ -3942,7 +3968,7 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag) | |||
3942 | } | 3968 | } |
3943 | } else { | 3969 | } else { |
3944 | while (--cntdn) { | 3970 | while (--cntdn) { |
3945 | mdelay (1); | 3971 | udelay (1000); |
3946 | intstat = CHIPREG_READ32(&ioc->chip->IntStatus); | 3972 | intstat = CHIPREG_READ32(&ioc->chip->IntStatus); |
3947 | if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) | 3973 | if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) |
3948 | break; | 3974 | break; |
@@ -3994,7 +4020,7 @@ WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag) | |||
3994 | intstat = CHIPREG_READ32(&ioc->chip->IntStatus); | 4020 | intstat = CHIPREG_READ32(&ioc->chip->IntStatus); |
3995 | if (intstat & MPI_HIS_DOORBELL_INTERRUPT) | 4021 | if (intstat & MPI_HIS_DOORBELL_INTERRUPT) |
3996 | break; | 4022 | break; |
3997 | mdelay(1); | 4023 | udelay (1000); |
3998 | count++; | 4024 | count++; |
3999 | } | 4025 | } |
4000 | } | 4026 | } |
@@ -4310,8 +4336,8 @@ mptbase_raid_process_event_data(MPT_ADAPTER *ioc, | |||
4310 | if ((reason >= MPI_EVENT_RAID_RC_PHYSDISK_CREATED && | 4336 | if ((reason >= MPI_EVENT_RAID_RC_PHYSDISK_CREATED && |
4311 | reason <= MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED) || | 4337 | reason <= MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED) || |
4312 | (reason == MPI_EVENT_RAID_RC_SMART_DATA)) { | 4338 | (reason == MPI_EVENT_RAID_RC_SMART_DATA)) { |
4313 | printk(MYIOC_s_INFO_FMT "RAID STATUS CHANGE for PhysDisk %d\n", | 4339 | printk(MYIOC_s_INFO_FMT "RAID STATUS CHANGE for PhysDisk %d id=%d\n", |
4314 | ioc->name, disk); | 4340 | ioc->name, disk, volume); |
4315 | } else { | 4341 | } else { |
4316 | printk(MYIOC_s_INFO_FMT "RAID STATUS CHANGE for VolumeID %d\n", | 4342 | printk(MYIOC_s_INFO_FMT "RAID STATUS CHANGE for VolumeID %d\n", |
4317 | ioc->name, volume); | 4343 | ioc->name, volume); |
@@ -4712,7 +4738,187 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) | |||
4712 | return 0; | 4738 | return 0; |
4713 | } | 4739 | } |
4714 | 4740 | ||
4715 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 4741 | /** |
4742 | * mpt_inactive_raid_list_free | ||
4743 | * | ||
4744 | * This clears this link list. | ||
4745 | * | ||
4746 | * @ioc - pointer to per adapter structure | ||
4747 | * | ||
4748 | **/ | ||
4749 | static void | ||
4750 | mpt_inactive_raid_list_free(MPT_ADAPTER *ioc) | ||
4751 | { | ||
4752 | struct inactive_raid_component_info *component_info, *pNext; | ||
4753 | |||
4754 | if (list_empty(&ioc->raid_data.inactive_list)) | ||
4755 | return; | ||
4756 | |||
4757 | down(&ioc->raid_data.inactive_list_mutex); | ||
4758 | list_for_each_entry_safe(component_info, pNext, | ||
4759 | &ioc->raid_data.inactive_list, list) { | ||
4760 | list_del(&component_info->list); | ||
4761 | kfree(component_info); | ||
4762 | } | ||
4763 | up(&ioc->raid_data.inactive_list_mutex); | ||
4764 | } | ||
4765 | |||
4766 | /** | ||
4767 | * mpt_inactive_raid_volumes | ||
4768 | * | ||
4769 | * This sets up link list of phy_disk_nums for devices belonging in an inactive volume | ||
4770 | * | ||
4771 | * @ioc - pointer to per adapter structure | ||
4772 | * @channel - volume channel | ||
4773 | * @id - volume target id | ||
4774 | * | ||
4775 | * | ||
4776 | **/ | ||
4777 | static void | ||
4778 | mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) | ||
4779 | { | ||
4780 | CONFIGPARMS cfg; | ||
4781 | ConfigPageHeader_t hdr; | ||
4782 | dma_addr_t dma_handle; | ||
4783 | pRaidVolumePage0_t buffer = NULL; | ||
4784 | int i; | ||
4785 | RaidPhysDiskPage0_t phys_disk; | ||
4786 | struct inactive_raid_component_info *component_info; | ||
4787 | int handle_inactive_volumes; | ||
4788 | |||
4789 | memset(&cfg, 0 , sizeof(CONFIGPARMS)); | ||
4790 | memset(&hdr, 0 , sizeof(ConfigPageHeader_t)); | ||
4791 | hdr.PageType = MPI_CONFIG_PAGETYPE_RAID_VOLUME; | ||
4792 | cfg.pageAddr = (channel << 8) + id; | ||
4793 | cfg.cfghdr.hdr = &hdr; | ||
4794 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | ||
4795 | |||
4796 | if (mpt_config(ioc, &cfg) != 0) | ||
4797 | goto out; | ||
4798 | |||
4799 | if (!hdr.PageLength) | ||
4800 | goto out; | ||
4801 | |||
4802 | buffer = pci_alloc_consistent(ioc->pcidev, hdr.PageLength * 4, | ||
4803 | &dma_handle); | ||
4804 | |||
4805 | if (!buffer) | ||
4806 | goto out; | ||
4807 | |||
4808 | cfg.physAddr = dma_handle; | ||
4809 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; | ||
4810 | |||
4811 | if (mpt_config(ioc, &cfg) != 0) | ||
4812 | goto out; | ||
4813 | |||
4814 | if (!buffer->NumPhysDisks) | ||
4815 | goto out; | ||
4816 | |||
4817 | handle_inactive_volumes = | ||
4818 | (buffer->VolumeStatus.Flags & MPI_RAIDVOL0_STATUS_FLAG_VOLUME_INACTIVE || | ||
4819 | (buffer->VolumeStatus.Flags & MPI_RAIDVOL0_STATUS_FLAG_ENABLED) == 0 || | ||
4820 | buffer->VolumeStatus.State == MPI_RAIDVOL0_STATUS_STATE_FAILED || | ||
4821 | buffer->VolumeStatus.State == MPI_RAIDVOL0_STATUS_STATE_MISSING) ? 1 : 0; | ||
4822 | |||
4823 | if (!handle_inactive_volumes) | ||
4824 | goto out; | ||
4825 | |||
4826 | down(&ioc->raid_data.inactive_list_mutex); | ||
4827 | for (i = 0; i < buffer->NumPhysDisks; i++) { | ||
4828 | if(mpt_raid_phys_disk_pg0(ioc, | ||
4829 | buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) | ||
4830 | continue; | ||
4831 | |||
4832 | if ((component_info = kmalloc(sizeof (*component_info), | ||
4833 | GFP_KERNEL)) == NULL) | ||
4834 | continue; | ||
4835 | |||
4836 | component_info->volumeID = id; | ||
4837 | component_info->volumeBus = channel; | ||
4838 | component_info->d.PhysDiskNum = phys_disk.PhysDiskNum; | ||
4839 | component_info->d.PhysDiskBus = phys_disk.PhysDiskBus; | ||
4840 | component_info->d.PhysDiskID = phys_disk.PhysDiskID; | ||
4841 | component_info->d.PhysDiskIOC = phys_disk.PhysDiskIOC; | ||
4842 | |||
4843 | list_add_tail(&component_info->list, | ||
4844 | &ioc->raid_data.inactive_list); | ||
4845 | } | ||
4846 | up(&ioc->raid_data.inactive_list_mutex); | ||
4847 | |||
4848 | out: | ||
4849 | if (buffer) | ||
4850 | pci_free_consistent(ioc->pcidev, hdr.PageLength * 4, buffer, | ||
4851 | dma_handle); | ||
4852 | } | ||
4853 | |||
4854 | /** | ||
4855 | * mpt_raid_phys_disk_pg0 - returns phys disk page zero | ||
4856 | * @ioc: Pointer to a Adapter Structure | ||
4857 | * @phys_disk_num: io unit unique phys disk num generated by the ioc | ||
4858 | * @phys_disk: requested payload data returned | ||
4859 | * | ||
4860 | * Return: | ||
4861 | * 0 on success | ||
4862 | * -EFAULT if read of config page header fails or data pointer not NULL | ||
4863 | * -ENOMEM if pci_alloc failed | ||
4864 | **/ | ||
4865 | int | ||
4866 | mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num, pRaidPhysDiskPage0_t phys_disk) | ||
4867 | { | ||
4868 | CONFIGPARMS cfg; | ||
4869 | ConfigPageHeader_t hdr; | ||
4870 | dma_addr_t dma_handle; | ||
4871 | pRaidPhysDiskPage0_t buffer = NULL; | ||
4872 | int rc; | ||
4873 | |||
4874 | memset(&cfg, 0 , sizeof(CONFIGPARMS)); | ||
4875 | memset(&hdr, 0 , sizeof(ConfigPageHeader_t)); | ||
4876 | |||
4877 | hdr.PageType = MPI_CONFIG_PAGETYPE_RAID_PHYSDISK; | ||
4878 | cfg.cfghdr.hdr = &hdr; | ||
4879 | cfg.physAddr = -1; | ||
4880 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | ||
4881 | |||
4882 | if (mpt_config(ioc, &cfg) != 0) { | ||
4883 | rc = -EFAULT; | ||
4884 | goto out; | ||
4885 | } | ||
4886 | |||
4887 | if (!hdr.PageLength) { | ||
4888 | rc = -EFAULT; | ||
4889 | goto out; | ||
4890 | } | ||
4891 | |||
4892 | buffer = pci_alloc_consistent(ioc->pcidev, hdr.PageLength * 4, | ||
4893 | &dma_handle); | ||
4894 | |||
4895 | if (!buffer) { | ||
4896 | rc = -ENOMEM; | ||
4897 | goto out; | ||
4898 | } | ||
4899 | |||
4900 | cfg.physAddr = dma_handle; | ||
4901 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; | ||
4902 | cfg.pageAddr = phys_disk_num; | ||
4903 | |||
4904 | if (mpt_config(ioc, &cfg) != 0) { | ||
4905 | rc = -EFAULT; | ||
4906 | goto out; | ||
4907 | } | ||
4908 | |||
4909 | rc = 0; | ||
4910 | memcpy(phys_disk, buffer, sizeof(*buffer)); | ||
4911 | phys_disk->MaxLBA = le32_to_cpu(buffer->MaxLBA); | ||
4912 | |||
4913 | out: | ||
4914 | |||
4915 | if (buffer) | ||
4916 | pci_free_consistent(ioc->pcidev, hdr.PageLength * 4, buffer, | ||
4917 | dma_handle); | ||
4918 | |||
4919 | return rc; | ||
4920 | } | ||
4921 | |||
4716 | /** | 4922 | /** |
4717 | * mpt_findImVolumes - Identify IDs of hidden disks and RAID Volumes | 4923 | * mpt_findImVolumes - Identify IDs of hidden disks and RAID Volumes |
4718 | * @ioc: Pointer to a Adapter Strucutre | 4924 | * @ioc: Pointer to a Adapter Strucutre |
@@ -4722,21 +4928,27 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) | |||
4722 | * 0 on success | 4928 | * 0 on success |
4723 | * -EFAULT if read of config page header fails or data pointer not NULL | 4929 | * -EFAULT if read of config page header fails or data pointer not NULL |
4724 | * -ENOMEM if pci_alloc failed | 4930 | * -ENOMEM if pci_alloc failed |
4725 | */ | 4931 | **/ |
4726 | int | 4932 | int |
4727 | mpt_findImVolumes(MPT_ADAPTER *ioc) | 4933 | mpt_findImVolumes(MPT_ADAPTER *ioc) |
4728 | { | 4934 | { |
4729 | IOCPage2_t *pIoc2; | 4935 | IOCPage2_t *pIoc2; |
4730 | u8 *mem; | 4936 | u8 *mem; |
4731 | ConfigPageIoc2RaidVol_t *pIocRv; | ||
4732 | dma_addr_t ioc2_dma; | 4937 | dma_addr_t ioc2_dma; |
4733 | CONFIGPARMS cfg; | 4938 | CONFIGPARMS cfg; |
4734 | ConfigPageHeader_t header; | 4939 | ConfigPageHeader_t header; |
4735 | int jj; | ||
4736 | int rc = 0; | 4940 | int rc = 0; |
4737 | int iocpage2sz; | 4941 | int iocpage2sz; |
4738 | u8 nVols, nPhys; | 4942 | int i; |
4739 | u8 vid, vbus, vioc; | 4943 | |
4944 | if (!ioc->ir_firmware) | ||
4945 | return 0; | ||
4946 | |||
4947 | /* Free the old page | ||
4948 | */ | ||
4949 | kfree(ioc->raid_data.pIocPg2); | ||
4950 | ioc->raid_data.pIocPg2 = NULL; | ||
4951 | mpt_inactive_raid_list_free(ioc); | ||
4740 | 4952 | ||
4741 | /* Read IOCP2 header then the page. | 4953 | /* Read IOCP2 header then the page. |
4742 | */ | 4954 | */ |
@@ -4764,55 +4976,23 @@ mpt_findImVolumes(MPT_ADAPTER *ioc) | |||
4764 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; | 4976 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; |
4765 | cfg.physAddr = ioc2_dma; | 4977 | cfg.physAddr = ioc2_dma; |
4766 | if (mpt_config(ioc, &cfg) != 0) | 4978 | if (mpt_config(ioc, &cfg) != 0) |
4767 | goto done_and_free; | 4979 | goto out; |
4980 | |||
4981 | mem = kmalloc(iocpage2sz, GFP_KERNEL); | ||
4982 | if (!mem) | ||
4983 | goto out; | ||
4768 | 4984 | ||
4769 | if ( (mem = (u8 *)ioc->raid_data.pIocPg2) == NULL ) { | ||
4770 | mem = kmalloc(iocpage2sz, GFP_ATOMIC); | ||
4771 | if (mem) { | ||
4772 | ioc->raid_data.pIocPg2 = (IOCPage2_t *) mem; | ||
4773 | } else { | ||
4774 | goto done_and_free; | ||
4775 | } | ||
4776 | } | ||
4777 | memcpy(mem, (u8 *)pIoc2, iocpage2sz); | 4985 | memcpy(mem, (u8 *)pIoc2, iocpage2sz); |
4986 | ioc->raid_data.pIocPg2 = (IOCPage2_t *) mem; | ||
4778 | 4987 | ||
4779 | /* Identify RAID Volume Id's */ | 4988 | mpt_read_ioc_pg_3(ioc); |
4780 | nVols = pIoc2->NumActiveVolumes; | ||
4781 | if ( nVols == 0) { | ||
4782 | /* No RAID Volume. | ||
4783 | */ | ||
4784 | goto done_and_free; | ||
4785 | } else { | ||
4786 | /* At least 1 RAID Volume | ||
4787 | */ | ||
4788 | pIocRv = pIoc2->RaidVolume; | ||
4789 | ioc->raid_data.isRaid = 0; | ||
4790 | for (jj = 0; jj < nVols; jj++, pIocRv++) { | ||
4791 | vid = pIocRv->VolumeID; | ||
4792 | vbus = pIocRv->VolumeBus; | ||
4793 | vioc = pIocRv->VolumeIOC; | ||
4794 | |||
4795 | /* find the match | ||
4796 | */ | ||
4797 | if (vbus == 0) { | ||
4798 | ioc->raid_data.isRaid |= (1 << vid); | ||
4799 | } else { | ||
4800 | /* Error! Always bus 0 | ||
4801 | */ | ||
4802 | } | ||
4803 | } | ||
4804 | } | ||
4805 | 4989 | ||
4806 | /* Identify Hidden Physical Disk Id's */ | 4990 | for (i = 0; i < pIoc2->NumActiveVolumes ; i++) |
4807 | nPhys = pIoc2->NumActivePhysDisks; | 4991 | mpt_inactive_raid_volumes(ioc, |
4808 | if (nPhys == 0) { | 4992 | pIoc2->RaidVolume[i].VolumeBus, |
4809 | /* No physical disks. | 4993 | pIoc2->RaidVolume[i].VolumeID); |
4810 | */ | ||
4811 | } else { | ||
4812 | mpt_read_ioc_pg_3(ioc); | ||
4813 | } | ||
4814 | 4994 | ||
4815 | done_and_free: | 4995 | out: |
4816 | pci_free_consistent(ioc->pcidev, iocpage2sz, pIoc2, ioc2_dma); | 4996 | pci_free_consistent(ioc->pcidev, iocpage2sz, pIoc2, ioc2_dma); |
4817 | 4997 | ||
4818 | return rc; | 4998 | return rc; |
@@ -4865,7 +5045,7 @@ mpt_read_ioc_pg_3(MPT_ADAPTER *ioc) | |||
4865 | cfg.physAddr = ioc3_dma; | 5045 | cfg.physAddr = ioc3_dma; |
4866 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; | 5046 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; |
4867 | if (mpt_config(ioc, &cfg) == 0) { | 5047 | if (mpt_config(ioc, &cfg) == 0) { |
4868 | mem = kmalloc(iocpage3sz, GFP_ATOMIC); | 5048 | mem = kmalloc(iocpage3sz, GFP_KERNEL); |
4869 | if (mem) { | 5049 | if (mem) { |
4870 | memcpy(mem, (u8 *)pIoc3, iocpage3sz); | 5050 | memcpy(mem, (u8 *)pIoc3, iocpage3sz); |
4871 | ioc->raid_data.pIocPg3 = (IOCPage3_t *) mem; | 5051 | ioc->raid_data.pIocPg3 = (IOCPage3_t *) mem; |
@@ -5679,8 +5859,6 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
5679 | return rc; | 5859 | return rc; |
5680 | } | 5860 | } |
5681 | 5861 | ||
5682 | # define EVENT_DESCR_STR_SZ 100 | ||
5683 | |||
5684 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 5862 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
5685 | static void | 5863 | static void |
5686 | EventDescriptionStr(u8 event, u32 evData0, char *evStr) | 5864 | EventDescriptionStr(u8 event, u32 evData0, char *evStr) |
@@ -5708,9 +5886,6 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5708 | break; | 5886 | break; |
5709 | case MPI_EVENT_RESCAN: | 5887 | case MPI_EVENT_RESCAN: |
5710 | ds = "Bus Rescan Event"; | 5888 | ds = "Bus Rescan Event"; |
5711 | /* Ok, do we need to do anything here? As far as | ||
5712 | I can tell, this is when a new device gets added | ||
5713 | to the loop. */ | ||
5714 | break; | 5889 | break; |
5715 | case MPI_EVENT_LINK_STATUS_CHANGE: | 5890 | case MPI_EVENT_LINK_STATUS_CHANGE: |
5716 | if (evData0 == MPI_EVENT_LINK_STATUS_FAILURE) | 5891 | if (evData0 == MPI_EVENT_LINK_STATUS_FAILURE) |
@@ -5787,48 +5962,63 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5787 | case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: | 5962 | case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: |
5788 | { | 5963 | { |
5789 | u8 id = (u8)(evData0); | 5964 | u8 id = (u8)(evData0); |
5965 | u8 channel = (u8)(evData0 >> 8); | ||
5790 | u8 ReasonCode = (u8)(evData0 >> 16); | 5966 | u8 ReasonCode = (u8)(evData0 >> 16); |
5791 | switch (ReasonCode) { | 5967 | switch (ReasonCode) { |
5792 | case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: | 5968 | case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: |
5793 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 5969 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5794 | "SAS Device Status Change: Added: id=%d", id); | 5970 | "SAS Device Status Change: Added: " |
5971 | "id=%d channel=%d", id, channel); | ||
5795 | break; | 5972 | break; |
5796 | case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: | 5973 | case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: |
5797 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 5974 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5798 | "SAS Device Status Change: Deleted: id=%d", id); | 5975 | "SAS Device Status Change: Deleted: " |
5976 | "id=%d channel=%d", id, channel); | ||
5799 | break; | 5977 | break; |
5800 | case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: | 5978 | case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: |
5801 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 5979 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5802 | "SAS Device Status Change: SMART Data: id=%d", | 5980 | "SAS Device Status Change: SMART Data: " |
5803 | id); | 5981 | "id=%d channel=%d", id, channel); |
5804 | break; | 5982 | break; |
5805 | case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: | 5983 | case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: |
5806 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 5984 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5807 | "SAS Device Status Change: No Persistancy: id=%d", id); | 5985 | "SAS Device Status Change: No Persistancy: " |
5986 | "id=%d channel=%d", id, channel); | ||
5987 | break; | ||
5988 | case MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED: | ||
5989 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
5990 | "SAS Device Status Change: Unsupported Device " | ||
5991 | "Discovered : id=%d channel=%d", id, channel); | ||
5808 | break; | 5992 | break; |
5809 | case MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET: | 5993 | case MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET: |
5810 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 5994 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5811 | "SAS Device Status Change: Internal Device Reset : id=%d", id); | 5995 | "SAS Device Status Change: Internal Device " |
5996 | "Reset : id=%d channel=%d", id, channel); | ||
5812 | break; | 5997 | break; |
5813 | case MPI_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL: | 5998 | case MPI_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL: |
5814 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 5999 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5815 | "SAS Device Status Change: Internal Task Abort : id=%d", id); | 6000 | "SAS Device Status Change: Internal Task " |
6001 | "Abort : id=%d channel=%d", id, channel); | ||
5816 | break; | 6002 | break; |
5817 | case MPI_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL: | 6003 | case MPI_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL: |
5818 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 6004 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5819 | "SAS Device Status Change: Internal Abort Task Set : id=%d", id); | 6005 | "SAS Device Status Change: Internal Abort " |
6006 | "Task Set : id=%d channel=%d", id, channel); | ||
5820 | break; | 6007 | break; |
5821 | case MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL: | 6008 | case MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL: |
5822 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 6009 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5823 | "SAS Device Status Change: Internal Clear Task Set : id=%d", id); | 6010 | "SAS Device Status Change: Internal Clear " |
6011 | "Task Set : id=%d channel=%d", id, channel); | ||
5824 | break; | 6012 | break; |
5825 | case MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL: | 6013 | case MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL: |
5826 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 6014 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5827 | "SAS Device Status Change: Internal Query Task : id=%d", id); | 6015 | "SAS Device Status Change: Internal Query " |
6016 | "Task : id=%d channel=%d", id, channel); | ||
5828 | break; | 6017 | break; |
5829 | default: | 6018 | default: |
5830 | snprintf(evStr, EVENT_DESCR_STR_SZ, | 6019 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5831 | "SAS Device Status Change: Unknown: id=%d", id); | 6020 | "SAS Device Status Change: Unknown: " |
6021 | "id=%d channel=%d", id, channel); | ||
5832 | break; | 6022 | break; |
5833 | } | 6023 | } |
5834 | break; | 6024 | break; |
@@ -5837,8 +6027,16 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5837 | ds = "Bus Timer Expired"; | 6027 | ds = "Bus Timer Expired"; |
5838 | break; | 6028 | break; |
5839 | case MPI_EVENT_QUEUE_FULL: | 6029 | case MPI_EVENT_QUEUE_FULL: |
5840 | ds = "Queue Full"; | 6030 | { |
6031 | u16 curr_depth = (u16)(evData0 >> 16); | ||
6032 | u8 channel = (u8)(evData0 >> 8); | ||
6033 | u8 id = (u8)(evData0); | ||
6034 | |||
6035 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6036 | "Queue Full: channel=%d id=%d depth=%d", | ||
6037 | channel, id, curr_depth); | ||
5841 | break; | 6038 | break; |
6039 | } | ||
5842 | case MPI_EVENT_SAS_SES: | 6040 | case MPI_EVENT_SAS_SES: |
5843 | ds = "SAS SES Event"; | 6041 | ds = "SAS SES Event"; |
5844 | break; | 6042 | break; |
@@ -5942,6 +6140,76 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5942 | ds = "SAS Log Entry Added"; | 6140 | ds = "SAS Log Entry Added"; |
5943 | break; | 6141 | break; |
5944 | 6142 | ||
6143 | case MPI_EVENT_SAS_BROADCAST_PRIMITIVE: | ||
6144 | { | ||
6145 | u8 phy_num = (u8)(evData0); | ||
6146 | u8 port_num = (u8)(evData0 >> 8); | ||
6147 | u8 port_width = (u8)(evData0 >> 16); | ||
6148 | u8 primative = (u8)(evData0 >> 24); | ||
6149 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6150 | "SAS Broadcase Primative: phy=%d port=%d " | ||
6151 | "width=%d primative=0x%02x", | ||
6152 | phy_num, port_num, port_width, primative); | ||
6153 | break; | ||
6154 | } | ||
6155 | |||
6156 | case MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE: | ||
6157 | { | ||
6158 | u8 reason = (u8)(evData0); | ||
6159 | u8 port_num = (u8)(evData0 >> 8); | ||
6160 | u16 handle = le16_to_cpu(evData0 >> 16); | ||
6161 | |||
6162 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6163 | "SAS Initiator Device Status Change: reason=0x%02x " | ||
6164 | "port=%d handle=0x%04x", | ||
6165 | reason, port_num, handle); | ||
6166 | break; | ||
6167 | } | ||
6168 | |||
6169 | case MPI_EVENT_SAS_INIT_TABLE_OVERFLOW: | ||
6170 | { | ||
6171 | u8 max_init = (u8)(evData0); | ||
6172 | u8 current_init = (u8)(evData0 >> 8); | ||
6173 | |||
6174 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6175 | "SAS Initiator Device Table Overflow: max initiators=%02d " | ||
6176 | "current initators=%02d", | ||
6177 | max_init, current_init); | ||
6178 | break; | ||
6179 | } | ||
6180 | case MPI_EVENT_SAS_SMP_ERROR: | ||
6181 | { | ||
6182 | u8 status = (u8)(evData0); | ||
6183 | u8 port_num = (u8)(evData0 >> 8); | ||
6184 | u8 result = (u8)(evData0 >> 16); | ||
6185 | |||
6186 | if (status == MPI_EVENT_SAS_SMP_FUNCTION_RESULT_VALID) | ||
6187 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6188 | "SAS SMP Error: port=%d result=0x%02x", | ||
6189 | port_num, result); | ||
6190 | else if (status == MPI_EVENT_SAS_SMP_CRC_ERROR) | ||
6191 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6192 | "SAS SMP Error: port=%d : CRC Error", | ||
6193 | port_num); | ||
6194 | else if (status == MPI_EVENT_SAS_SMP_TIMEOUT) | ||
6195 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6196 | "SAS SMP Error: port=%d : Timeout", | ||
6197 | port_num); | ||
6198 | else if (status == MPI_EVENT_SAS_SMP_NO_DESTINATION) | ||
6199 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6200 | "SAS SMP Error: port=%d : No Destination", | ||
6201 | port_num); | ||
6202 | else if (status == MPI_EVENT_SAS_SMP_BAD_DESTINATION) | ||
6203 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6204 | "SAS SMP Error: port=%d : Bad Destination", | ||
6205 | port_num); | ||
6206 | else | ||
6207 | snprintf(evStr, EVENT_DESCR_STR_SZ, | ||
6208 | "SAS SMP Error: port=%d : status=0x%02x", | ||
6209 | port_num, status); | ||
6210 | break; | ||
6211 | } | ||
6212 | |||
5945 | /* | 6213 | /* |
5946 | * MPT base "custom" events may be added here... | 6214 | * MPT base "custom" events may be added here... |
5947 | */ | 6215 | */ |
@@ -6205,10 +6473,11 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info) | |||
6205 | "Abort", /* 12h */ | 6473 | "Abort", /* 12h */ |
6206 | "IO Not Yet Executed", /* 13h */ | 6474 | "IO Not Yet Executed", /* 13h */ |
6207 | "IO Executed", /* 14h */ | 6475 | "IO Executed", /* 14h */ |
6208 | "Persistent Reservation Out Not Affiliation Owner", /* 15h */ | 6476 | "Persistent Reservation Out Not Affiliation " |
6477 | "Owner", /* 15h */ | ||
6209 | "Open Transmit DMA Abort", /* 16h */ | 6478 | "Open Transmit DMA Abort", /* 16h */ |
6210 | "IO Device Missing Delay Retry", /* 17h */ | 6479 | "IO Device Missing Delay Retry", /* 17h */ |
6211 | NULL, /* 18h */ | 6480 | "IO Cancelled Due to Recieve Error", /* 18h */ |
6212 | NULL, /* 19h */ | 6481 | NULL, /* 19h */ |
6213 | NULL, /* 1Ah */ | 6482 | NULL, /* 1Ah */ |
6214 | NULL, /* 1Bh */ | 6483 | NULL, /* 1Bh */ |
@@ -6218,6 +6487,96 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info) | |||
6218 | NULL, /* 1Fh */ | 6487 | NULL, /* 1Fh */ |
6219 | "Enclosure Management" /* 20h */ | 6488 | "Enclosure Management" /* 20h */ |
6220 | }; | 6489 | }; |
6490 | static char *ir_code_str[] = { | ||
6491 | "Raid Action Error", /* 00h */ | ||
6492 | NULL, /* 00h */ | ||
6493 | NULL, /* 01h */ | ||
6494 | NULL, /* 02h */ | ||
6495 | NULL, /* 03h */ | ||
6496 | NULL, /* 04h */ | ||
6497 | NULL, /* 05h */ | ||
6498 | NULL, /* 06h */ | ||
6499 | NULL /* 07h */ | ||
6500 | }; | ||
6501 | static char *raid_sub_code_str[] = { | ||
6502 | NULL, /* 00h */ | ||
6503 | "Volume Creation Failed: Data Passed too " | ||
6504 | "Large", /* 01h */ | ||
6505 | "Volume Creation Failed: Duplicate Volumes " | ||
6506 | "Attempted", /* 02h */ | ||
6507 | "Volume Creation Failed: Max Number " | ||
6508 | "Supported Volumes Exceeded", /* 03h */ | ||
6509 | "Volume Creation Failed: DMA Error", /* 04h */ | ||
6510 | "Volume Creation Failed: Invalid Volume Type", /* 05h */ | ||
6511 | "Volume Creation Failed: Error Reading " | ||
6512 | "MFG Page 4", /* 06h */ | ||
6513 | "Volume Creation Failed: Creating Internal " | ||
6514 | "Structures", /* 07h */ | ||
6515 | NULL, /* 08h */ | ||
6516 | NULL, /* 09h */ | ||
6517 | NULL, /* 0Ah */ | ||
6518 | NULL, /* 0Bh */ | ||
6519 | NULL, /* 0Ch */ | ||
6520 | NULL, /* 0Dh */ | ||
6521 | NULL, /* 0Eh */ | ||
6522 | NULL, /* 0Fh */ | ||
6523 | "Activation failed: Already Active Volume", /* 10h */ | ||
6524 | "Activation failed: Unsupported Volume Type", /* 11h */ | ||
6525 | "Activation failed: Too Many Active Volumes", /* 12h */ | ||
6526 | "Activation failed: Volume ID in Use", /* 13h */ | ||
6527 | "Activation failed: Reported Failure", /* 14h */ | ||
6528 | "Activation failed: Importing a Volume", /* 15h */ | ||
6529 | NULL, /* 16h */ | ||
6530 | NULL, /* 17h */ | ||
6531 | NULL, /* 18h */ | ||
6532 | NULL, /* 19h */ | ||
6533 | NULL, /* 1Ah */ | ||
6534 | NULL, /* 1Bh */ | ||
6535 | NULL, /* 1Ch */ | ||
6536 | NULL, /* 1Dh */ | ||
6537 | NULL, /* 1Eh */ | ||
6538 | NULL, /* 1Fh */ | ||
6539 | "Phys Disk failed: Too Many Phys Disks", /* 20h */ | ||
6540 | "Phys Disk failed: Data Passed too Large", /* 21h */ | ||
6541 | "Phys Disk failed: DMA Error", /* 22h */ | ||
6542 | "Phys Disk failed: Invalid <channel:id>", /* 23h */ | ||
6543 | "Phys Disk failed: Creating Phys Disk Config " | ||
6544 | "Page", /* 24h */ | ||
6545 | NULL, /* 25h */ | ||
6546 | NULL, /* 26h */ | ||
6547 | NULL, /* 27h */ | ||
6548 | NULL, /* 28h */ | ||
6549 | NULL, /* 29h */ | ||
6550 | NULL, /* 2Ah */ | ||
6551 | NULL, /* 2Bh */ | ||
6552 | NULL, /* 2Ch */ | ||
6553 | NULL, /* 2Dh */ | ||
6554 | NULL, /* 2Eh */ | ||
6555 | NULL, /* 2Fh */ | ||
6556 | "Compatibility Error: IR Disabled", /* 30h */ | ||
6557 | "Compatibility Error: Inquiry Comand Failed", /* 31h */ | ||
6558 | "Compatibility Error: Device not Direct Access " | ||
6559 | "Device ", /* 32h */ | ||
6560 | "Compatibility Error: Removable Device Found", /* 33h */ | ||
6561 | "Compatibility Error: Device SCSI Version not " | ||
6562 | "2 or Higher", /* 34h */ | ||
6563 | "Compatibility Error: SATA Device, 48 BIT LBA " | ||
6564 | "not Supported", /* 35h */ | ||
6565 | "Compatibility Error: Device doesn't have " | ||
6566 | "512 Byte Block Sizes", /* 36h */ | ||
6567 | "Compatibility Error: Volume Type Check Failed", /* 37h */ | ||
6568 | "Compatibility Error: Volume Type is " | ||
6569 | "Unsupported by FW", /* 38h */ | ||
6570 | "Compatibility Error: Disk Drive too Small for " | ||
6571 | "use in Volume", /* 39h */ | ||
6572 | "Compatibility Error: Phys Disk for Create " | ||
6573 | "Volume not Found", /* 3Ah */ | ||
6574 | "Compatibility Error: Too Many or too Few " | ||
6575 | "Disks for Volume Type", /* 3Bh */ | ||
6576 | "Compatibility Error: Disk stripe Sizes " | ||
6577 | "Must be 64KB", /* 3Ch */ | ||
6578 | "Compatibility Error: IME Size Limited to < 2TB", /* 3Dh */ | ||
6579 | }; | ||
6221 | 6580 | ||
6222 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6581 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
6223 | /** | 6582 | /** |
@@ -6226,7 +6585,7 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info) | |||
6226 | * @log_info: U32 LogInfo reply word from the IOC | 6585 | * @log_info: U32 LogInfo reply word from the IOC |
6227 | * | 6586 | * |
6228 | * Refer to lsi/mpi_log_sas.h. | 6587 | * Refer to lsi/mpi_log_sas.h. |
6229 | */ | 6588 | **/ |
6230 | static void | 6589 | static void |
6231 | mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info) | 6590 | mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info) |
6232 | { | 6591 | { |
@@ -6240,56 +6599,165 @@ union loginfo_type { | |||
6240 | }dw; | 6599 | }dw; |
6241 | }; | 6600 | }; |
6242 | union loginfo_type sas_loginfo; | 6601 | union loginfo_type sas_loginfo; |
6602 | char *originator_desc = NULL; | ||
6243 | char *code_desc = NULL; | 6603 | char *code_desc = NULL; |
6604 | char *sub_code_desc = NULL; | ||
6244 | 6605 | ||
6245 | sas_loginfo.loginfo = log_info; | 6606 | sas_loginfo.loginfo = log_info; |
6246 | if ((sas_loginfo.dw.bus_type != 3 /*SAS*/) && | 6607 | if ((sas_loginfo.dw.bus_type != 3 /*SAS*/) && |
6247 | (sas_loginfo.dw.originator < sizeof(originator_str)/sizeof(char*))) | 6608 | (sas_loginfo.dw.originator < sizeof(originator_str)/sizeof(char*))) |
6248 | return; | 6609 | return; |
6249 | if ((sas_loginfo.dw.originator == 0 /*IOP*/) && | 6610 | |
6250 | (sas_loginfo.dw.code < sizeof(iop_code_str)/sizeof(char*))) { | 6611 | originator_desc = originator_str[sas_loginfo.dw.originator]; |
6251 | code_desc = iop_code_str[sas_loginfo.dw.code]; | 6612 | |
6252 | }else if ((sas_loginfo.dw.originator == 1 /*PL*/) && | 6613 | switch (sas_loginfo.dw.originator) { |
6253 | (sas_loginfo.dw.code < sizeof(pl_code_str)/sizeof(char*) )) { | 6614 | |
6254 | code_desc = pl_code_str[sas_loginfo.dw.code]; | 6615 | case 0: /* IOP */ |
6616 | if (sas_loginfo.dw.code < | ||
6617 | sizeof(iop_code_str)/sizeof(char*)) | ||
6618 | code_desc = iop_code_str[sas_loginfo.dw.code]; | ||
6619 | break; | ||
6620 | case 1: /* PL */ | ||
6621 | if (sas_loginfo.dw.code < | ||
6622 | sizeof(pl_code_str)/sizeof(char*)) | ||
6623 | code_desc = pl_code_str[sas_loginfo.dw.code]; | ||
6624 | break; | ||
6625 | case 2: /* IR */ | ||
6626 | if (sas_loginfo.dw.code >= | ||
6627 | sizeof(ir_code_str)/sizeof(char*)) | ||
6628 | break; | ||
6629 | code_desc = ir_code_str[sas_loginfo.dw.code]; | ||
6630 | if (sas_loginfo.dw.subcode >= | ||
6631 | sizeof(raid_sub_code_str)/sizeof(char*)) | ||
6632 | break; | ||
6633 | if (sas_loginfo.dw.code == 0) | ||
6634 | sub_code_desc = | ||
6635 | raid_sub_code_str[sas_loginfo.dw.subcode]; | ||
6636 | break; | ||
6637 | default: | ||
6638 | return; | ||
6255 | } | 6639 | } |
6256 | 6640 | ||
6257 | if (code_desc != NULL) | 6641 | if (sub_code_desc != NULL) |
6642 | printk(MYIOC_s_INFO_FMT | ||
6643 | "LogInfo(0x%08x): Originator={%s}, Code={%s}," | ||
6644 | " SubCode={%s}\n", | ||
6645 | ioc->name, log_info, originator_desc, code_desc, | ||
6646 | sub_code_desc); | ||
6647 | else if (code_desc != NULL) | ||
6258 | printk(MYIOC_s_INFO_FMT | 6648 | printk(MYIOC_s_INFO_FMT |
6259 | "LogInfo(0x%08x): Originator={%s}, Code={%s}," | 6649 | "LogInfo(0x%08x): Originator={%s}, Code={%s}," |
6260 | " SubCode(0x%04x)\n", | 6650 | " SubCode(0x%04x)\n", |
6261 | ioc->name, | 6651 | ioc->name, log_info, originator_desc, code_desc, |
6262 | log_info, | ||
6263 | originator_str[sas_loginfo.dw.originator], | ||
6264 | code_desc, | ||
6265 | sas_loginfo.dw.subcode); | 6652 | sas_loginfo.dw.subcode); |
6266 | else | 6653 | else |
6267 | printk(MYIOC_s_INFO_FMT | 6654 | printk(MYIOC_s_INFO_FMT |
6268 | "LogInfo(0x%08x): Originator={%s}, Code=(0x%02x)," | 6655 | "LogInfo(0x%08x): Originator={%s}, Code=(0x%02x)," |
6269 | " SubCode(0x%04x)\n", | 6656 | " SubCode(0x%04x)\n", |
6270 | ioc->name, | 6657 | ioc->name, log_info, originator_desc, |
6271 | log_info, | 6658 | sas_loginfo.dw.code, sas_loginfo.dw.subcode); |
6272 | originator_str[sas_loginfo.dw.originator], | ||
6273 | sas_loginfo.dw.code, | ||
6274 | sas_loginfo.dw.subcode); | ||
6275 | } | 6659 | } |
6276 | 6660 | ||
6661 | #ifdef MPT_DEBUG_REPLY | ||
6277 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6662 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
6278 | /** | 6663 | /** |
6279 | * mpt_sp_ioc_info - IOC information returned from SCSI Parallel IOC. | 6664 | * mpt_iocstatus_info_config - IOCSTATUS information for config pages |
6665 | * @ioc: Pointer to MPT_ADAPTER structure | ||
6666 | * ioc_status: U32 IOCStatus word from IOC | ||
6667 | * @mf: Pointer to MPT request frame | ||
6668 | * | ||
6669 | * Refer to lsi/mpi.h. | ||
6670 | **/ | ||
6671 | static void | ||
6672 | mpt_iocstatus_info_config(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf) | ||
6673 | { | ||
6674 | Config_t *pReq = (Config_t *)mf; | ||
6675 | char extend_desc[EVENT_DESCR_STR_SZ]; | ||
6676 | char *desc = NULL; | ||
6677 | u32 form; | ||
6678 | u8 page_type; | ||
6679 | |||
6680 | if (pReq->Header.PageType == MPI_CONFIG_PAGETYPE_EXTENDED) | ||
6681 | page_type = pReq->ExtPageType; | ||
6682 | else | ||
6683 | page_type = pReq->Header.PageType; | ||
6684 | |||
6685 | /* | ||
6686 | * ignore invalid page messages for GET_NEXT_HANDLE | ||
6687 | */ | ||
6688 | form = le32_to_cpu(pReq->PageAddress); | ||
6689 | if (ioc_status == MPI_IOCSTATUS_CONFIG_INVALID_PAGE) { | ||
6690 | if (page_type == MPI_CONFIG_EXTPAGETYPE_SAS_DEVICE || | ||
6691 | page_type == MPI_CONFIG_EXTPAGETYPE_SAS_EXPANDER || | ||
6692 | page_type == MPI_CONFIG_EXTPAGETYPE_ENCLOSURE) { | ||
6693 | if ((form >> MPI_SAS_DEVICE_PGAD_FORM_SHIFT) == | ||
6694 | MPI_SAS_DEVICE_PGAD_FORM_GET_NEXT_HANDLE) | ||
6695 | return; | ||
6696 | } | ||
6697 | if (page_type == MPI_CONFIG_PAGETYPE_FC_DEVICE) | ||
6698 | if ((form & MPI_FC_DEVICE_PGAD_FORM_MASK) == | ||
6699 | MPI_FC_DEVICE_PGAD_FORM_NEXT_DID) | ||
6700 | return; | ||
6701 | } | ||
6702 | |||
6703 | snprintf(extend_desc, EVENT_DESCR_STR_SZ, | ||
6704 | "type=%02Xh, page=%02Xh, action=%02Xh, form=%08Xh", | ||
6705 | page_type, pReq->Header.PageNumber, pReq->Action, form); | ||
6706 | |||
6707 | switch (ioc_status) { | ||
6708 | |||
6709 | case MPI_IOCSTATUS_CONFIG_INVALID_ACTION: /* 0x0020 */ | ||
6710 | desc = "Config Page Invalid Action"; | ||
6711 | break; | ||
6712 | |||
6713 | case MPI_IOCSTATUS_CONFIG_INVALID_TYPE: /* 0x0021 */ | ||
6714 | desc = "Config Page Invalid Type"; | ||
6715 | break; | ||
6716 | |||
6717 | case MPI_IOCSTATUS_CONFIG_INVALID_PAGE: /* 0x0022 */ | ||
6718 | desc = "Config Page Invalid Page"; | ||
6719 | break; | ||
6720 | |||
6721 | case MPI_IOCSTATUS_CONFIG_INVALID_DATA: /* 0x0023 */ | ||
6722 | desc = "Config Page Invalid Data"; | ||
6723 | break; | ||
6724 | |||
6725 | case MPI_IOCSTATUS_CONFIG_NO_DEFAULTS: /* 0x0024 */ | ||
6726 | desc = "Config Page No Defaults"; | ||
6727 | break; | ||
6728 | |||
6729 | case MPI_IOCSTATUS_CONFIG_CANT_COMMIT: /* 0x0025 */ | ||
6730 | desc = "Config Page Can't Commit"; | ||
6731 | break; | ||
6732 | } | ||
6733 | |||
6734 | if (!desc) | ||
6735 | return; | ||
6736 | |||
6737 | printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04X): %s: %s\n", | ||
6738 | ioc->name, ioc_status, desc, extend_desc); | ||
6739 | } | ||
6740 | |||
6741 | /** | ||
6742 | * mpt_iocstatus_info - IOCSTATUS information returned from IOC. | ||
6280 | * @ioc: Pointer to MPT_ADAPTER structure | 6743 | * @ioc: Pointer to MPT_ADAPTER structure |
6281 | * @ioc_status: U32 IOCStatus word from IOC | 6744 | * @ioc_status: U32 IOCStatus word from IOC |
6282 | * @mf: Pointer to MPT request frame | 6745 | * @mf: Pointer to MPT request frame |
6283 | * | 6746 | * |
6284 | * Refer to lsi/mpi.h. | 6747 | * Refer to lsi/mpi.h. |
6285 | */ | 6748 | **/ |
6286 | static void | 6749 | static void |
6287 | mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf) | 6750 | mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf) |
6288 | { | 6751 | { |
6289 | u32 status = ioc_status & MPI_IOCSTATUS_MASK; | 6752 | u32 status = ioc_status & MPI_IOCSTATUS_MASK; |
6290 | char *desc = NULL; | 6753 | char *desc = NULL; |
6291 | 6754 | ||
6292 | switch (status) { | 6755 | switch (status) { |
6756 | |||
6757 | /****************************************************************************/ | ||
6758 | /* Common IOCStatus values for all replies */ | ||
6759 | /****************************************************************************/ | ||
6760 | |||
6293 | case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */ | 6761 | case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */ |
6294 | desc = "Invalid Function"; | 6762 | desc = "Invalid Function"; |
6295 | break; | 6763 | break; |
@@ -6322,84 +6790,180 @@ mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf) | |||
6322 | desc = "Invalid State"; | 6790 | desc = "Invalid State"; |
6323 | break; | 6791 | break; |
6324 | 6792 | ||
6793 | /****************************************************************************/ | ||
6794 | /* Config IOCStatus values */ | ||
6795 | /****************************************************************************/ | ||
6796 | |||
6325 | case MPI_IOCSTATUS_CONFIG_INVALID_ACTION: /* 0x0020 */ | 6797 | case MPI_IOCSTATUS_CONFIG_INVALID_ACTION: /* 0x0020 */ |
6326 | case MPI_IOCSTATUS_CONFIG_INVALID_TYPE: /* 0x0021 */ | 6798 | case MPI_IOCSTATUS_CONFIG_INVALID_TYPE: /* 0x0021 */ |
6327 | case MPI_IOCSTATUS_CONFIG_INVALID_PAGE: /* 0x0022 */ | 6799 | case MPI_IOCSTATUS_CONFIG_INVALID_PAGE: /* 0x0022 */ |
6328 | case MPI_IOCSTATUS_CONFIG_INVALID_DATA: /* 0x0023 */ | 6800 | case MPI_IOCSTATUS_CONFIG_INVALID_DATA: /* 0x0023 */ |
6329 | case MPI_IOCSTATUS_CONFIG_NO_DEFAULTS: /* 0x0024 */ | 6801 | case MPI_IOCSTATUS_CONFIG_NO_DEFAULTS: /* 0x0024 */ |
6330 | case MPI_IOCSTATUS_CONFIG_CANT_COMMIT: /* 0x0025 */ | 6802 | case MPI_IOCSTATUS_CONFIG_CANT_COMMIT: /* 0x0025 */ |
6331 | /* No message for Config IOCStatus values */ | 6803 | mpt_iocstatus_info_config(ioc, status, mf); |
6332 | break; | 6804 | break; |
6333 | 6805 | ||
6806 | /****************************************************************************/ | ||
6807 | /* SCSIIO Reply (SPI, FCP, SAS) initiator values */ | ||
6808 | /* */ | ||
6809 | /* Look at mptscsih_iocstatus_info_scsiio in mptscsih.c */ | ||
6810 | /* */ | ||
6811 | /****************************************************************************/ | ||
6812 | |||
6334 | case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ | 6813 | case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ |
6335 | /* No message for recovered error | 6814 | case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ |
6336 | desc = "SCSI Recovered Error"; | 6815 | case MPI_IOCSTATUS_SCSI_INVALID_BUS: /* 0x0041 */ |
6337 | */ | 6816 | case MPI_IOCSTATUS_SCSI_INVALID_TARGETID: /* 0x0042 */ |
6817 | case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ | ||
6818 | case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */ | ||
6819 | case MPI_IOCSTATUS_SCSI_IO_DATA_ERROR: /* 0x0046 */ | ||
6820 | case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */ | ||
6821 | case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */ | ||
6822 | case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */ | ||
6823 | case MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED: /* 0x004A */ | ||
6824 | case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */ | ||
6825 | case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */ | ||
6338 | break; | 6826 | break; |
6339 | 6827 | ||
6340 | case MPI_IOCSTATUS_SCSI_INVALID_BUS: /* 0x0041 */ | 6828 | /****************************************************************************/ |
6341 | desc = "SCSI Invalid Bus"; | 6829 | /* SCSI Target values */ |
6830 | /****************************************************************************/ | ||
6831 | |||
6832 | case MPI_IOCSTATUS_TARGET_PRIORITY_IO: /* 0x0060 */ | ||
6833 | desc = "Target: Priority IO"; | ||
6342 | break; | 6834 | break; |
6343 | 6835 | ||
6344 | case MPI_IOCSTATUS_SCSI_INVALID_TARGETID: /* 0x0042 */ | 6836 | case MPI_IOCSTATUS_TARGET_INVALID_PORT: /* 0x0061 */ |
6345 | desc = "SCSI Invalid TargetID"; | 6837 | desc = "Target: Invalid Port"; |
6346 | break; | 6838 | break; |
6347 | 6839 | ||
6348 | case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ | 6840 | case MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX: /* 0x0062 */ |
6349 | { | 6841 | desc = "Target Invalid IO Index:"; |
6350 | SCSIIORequest_t *pScsiReq = (SCSIIORequest_t *) mf; | ||
6351 | U8 cdb = pScsiReq->CDB[0]; | ||
6352 | if (cdb != 0x12) { /* Inquiry is issued for device scanning */ | ||
6353 | desc = "SCSI Device Not There"; | ||
6354 | } | ||
6355 | break; | 6842 | break; |
6356 | } | ||
6357 | 6843 | ||
6358 | case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */ | 6844 | case MPI_IOCSTATUS_TARGET_ABORTED: /* 0x0063 */ |
6359 | desc = "SCSI Data Overrun"; | 6845 | desc = "Target: Aborted"; |
6360 | break; | 6846 | break; |
6361 | 6847 | ||
6362 | case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ | 6848 | case MPI_IOCSTATUS_TARGET_NO_CONN_RETRYABLE: /* 0x0064 */ |
6363 | /* This error is checked in scsi_io_done(). Skip. | 6849 | desc = "Target: No Conn Retryable"; |
6364 | desc = "SCSI Data Underrun"; | ||
6365 | */ | ||
6366 | break; | 6850 | break; |
6367 | 6851 | ||
6368 | case MPI_IOCSTATUS_SCSI_IO_DATA_ERROR: /* 0x0046 */ | 6852 | case MPI_IOCSTATUS_TARGET_NO_CONNECTION: /* 0x0065 */ |
6369 | desc = "SCSI I/O Data Error"; | 6853 | desc = "Target: No Connection"; |
6370 | break; | 6854 | break; |
6371 | 6855 | ||
6372 | case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */ | 6856 | case MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH: /* 0x006A */ |
6373 | desc = "SCSI Protocol Error"; | 6857 | desc = "Target: Transfer Count Mismatch"; |
6374 | break; | 6858 | break; |
6375 | 6859 | ||
6376 | case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */ | 6860 | case MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT: /* 0x006B */ |
6377 | desc = "SCSI Task Terminated"; | 6861 | desc = "Target: STS Data not Sent"; |
6378 | break; | 6862 | break; |
6379 | 6863 | ||
6380 | case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */ | 6864 | case MPI_IOCSTATUS_TARGET_DATA_OFFSET_ERROR: /* 0x006D */ |
6381 | desc = "SCSI Residual Mismatch"; | 6865 | desc = "Target: Data Offset Error"; |
6382 | break; | 6866 | break; |
6383 | 6867 | ||
6384 | case MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED: /* 0x004A */ | 6868 | case MPI_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA: /* 0x006E */ |
6385 | desc = "SCSI Task Management Failed"; | 6869 | desc = "Target: Too Much Write Data"; |
6386 | break; | 6870 | break; |
6387 | 6871 | ||
6388 | case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */ | 6872 | case MPI_IOCSTATUS_TARGET_IU_TOO_SHORT: /* 0x006F */ |
6389 | desc = "SCSI IOC Terminated"; | 6873 | desc = "Target: IU Too Short"; |
6390 | break; | 6874 | break; |
6391 | 6875 | ||
6392 | case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */ | 6876 | case MPI_IOCSTATUS_TARGET_ACK_NAK_TIMEOUT: /* 0x0070 */ |
6393 | desc = "SCSI Ext Terminated"; | 6877 | desc = "Target: ACK NAK Timeout"; |
6878 | break; | ||
6879 | |||
6880 | case MPI_IOCSTATUS_TARGET_NAK_RECEIVED: /* 0x0071 */ | ||
6881 | desc = "Target: Nak Received"; | ||
6882 | break; | ||
6883 | |||
6884 | /****************************************************************************/ | ||
6885 | /* Fibre Channel Direct Access values */ | ||
6886 | /****************************************************************************/ | ||
6887 | |||
6888 | case MPI_IOCSTATUS_FC_ABORTED: /* 0x0066 */ | ||
6889 | desc = "FC: Aborted"; | ||
6890 | break; | ||
6891 | |||
6892 | case MPI_IOCSTATUS_FC_RX_ID_INVALID: /* 0x0067 */ | ||
6893 | desc = "FC: RX ID Invalid"; | ||
6894 | break; | ||
6895 | |||
6896 | case MPI_IOCSTATUS_FC_DID_INVALID: /* 0x0068 */ | ||
6897 | desc = "FC: DID Invalid"; | ||
6898 | break; | ||
6899 | |||
6900 | case MPI_IOCSTATUS_FC_NODE_LOGGED_OUT: /* 0x0069 */ | ||
6901 | desc = "FC: Node Logged Out"; | ||
6902 | break; | ||
6903 | |||
6904 | case MPI_IOCSTATUS_FC_EXCHANGE_CANCELED: /* 0x006C */ | ||
6905 | desc = "FC: Exchange Canceled"; | ||
6906 | break; | ||
6907 | |||
6908 | /****************************************************************************/ | ||
6909 | /* LAN values */ | ||
6910 | /****************************************************************************/ | ||
6911 | |||
6912 | case MPI_IOCSTATUS_LAN_DEVICE_NOT_FOUND: /* 0x0080 */ | ||
6913 | desc = "LAN: Device not Found"; | ||
6914 | break; | ||
6915 | |||
6916 | case MPI_IOCSTATUS_LAN_DEVICE_FAILURE: /* 0x0081 */ | ||
6917 | desc = "LAN: Device Failure"; | ||
6918 | break; | ||
6919 | |||
6920 | case MPI_IOCSTATUS_LAN_TRANSMIT_ERROR: /* 0x0082 */ | ||
6921 | desc = "LAN: Transmit Error"; | ||
6922 | break; | ||
6923 | |||
6924 | case MPI_IOCSTATUS_LAN_TRANSMIT_ABORTED: /* 0x0083 */ | ||
6925 | desc = "LAN: Transmit Aborted"; | ||
6926 | break; | ||
6927 | |||
6928 | case MPI_IOCSTATUS_LAN_RECEIVE_ERROR: /* 0x0084 */ | ||
6929 | desc = "LAN: Receive Error"; | ||
6930 | break; | ||
6931 | |||
6932 | case MPI_IOCSTATUS_LAN_RECEIVE_ABORTED: /* 0x0085 */ | ||
6933 | desc = "LAN: Receive Aborted"; | ||
6934 | break; | ||
6935 | |||
6936 | case MPI_IOCSTATUS_LAN_PARTIAL_PACKET: /* 0x0086 */ | ||
6937 | desc = "LAN: Partial Packet"; | ||
6938 | break; | ||
6939 | |||
6940 | case MPI_IOCSTATUS_LAN_CANCELED: /* 0x0087 */ | ||
6941 | desc = "LAN: Canceled"; | ||
6942 | break; | ||
6943 | |||
6944 | /****************************************************************************/ | ||
6945 | /* Serial Attached SCSI values */ | ||
6946 | /****************************************************************************/ | ||
6947 | |||
6948 | case MPI_IOCSTATUS_SAS_SMP_REQUEST_FAILED: /* 0x0090 */ | ||
6949 | desc = "SAS: SMP Request Failed"; | ||
6950 | break; | ||
6951 | |||
6952 | case MPI_IOCSTATUS_SAS_SMP_DATA_OVERRUN: /* 0x0090 */ | ||
6953 | desc = "SAS: SMP Data Overrun"; | ||
6394 | break; | 6954 | break; |
6395 | 6955 | ||
6396 | default: | 6956 | default: |
6397 | desc = "Others"; | 6957 | desc = "Others"; |
6398 | break; | 6958 | break; |
6399 | } | 6959 | } |
6400 | if (desc != NULL) | 6960 | |
6401 | printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04x): %s\n", ioc->name, status, desc); | 6961 | if (!desc) |
6962 | return; | ||
6963 | |||
6964 | printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04X): %s\n", ioc->name, status, desc); | ||
6402 | } | 6965 | } |
6966 | #endif | ||
6403 | 6967 | ||
6404 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6968 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
6405 | EXPORT_SYMBOL(mpt_attach); | 6969 | EXPORT_SYMBOL(mpt_attach); |
@@ -6434,6 +6998,7 @@ EXPORT_SYMBOL(mpt_findImVolumes); | |||
6434 | EXPORT_SYMBOL(mpt_alloc_fw_memory); | 6998 | EXPORT_SYMBOL(mpt_alloc_fw_memory); |
6435 | EXPORT_SYMBOL(mpt_free_fw_memory); | 6999 | EXPORT_SYMBOL(mpt_free_fw_memory); |
6436 | EXPORT_SYMBOL(mptbase_sas_persist_operation); | 7000 | EXPORT_SYMBOL(mptbase_sas_persist_operation); |
7001 | EXPORT_SYMBOL(mpt_raid_phys_disk_pg0); | ||
6437 | 7002 | ||
6438 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 7003 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
6439 | /** | 7004 | /** |