diff options
author | Brian King <brking@us.ibm.com> | 2006-11-21 11:28:35 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:21:44 -0500 |
commit | 49dc6a18185c12bae4980d17512fbe54ca6bae54 (patch) | |
tree | dc3e9dc84647d485622c42b9715dceee00ecab19 /drivers/scsi/ipr.h | |
parent | 9d66bdf81f97673b6e330a26438fcaea38c26cd5 (diff) |
[SCSI] ipr: Add support for logging SAS fabric errors
Adds support for logging SAS fabric errors logged by
the ipr firmware.
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ipr.h')
-rw-r--r-- | drivers/scsi/ipr.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 75669251fb63..44b15e4b6edf 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -737,6 +737,64 @@ struct ipr_hostrcb_type_17_error { | |||
737 | u32 data[476]; | 737 | u32 data[476]; |
738 | }__attribute__((packed, aligned (4))); | 738 | }__attribute__((packed, aligned (4))); |
739 | 739 | ||
740 | struct ipr_hostrcb_config_element { | ||
741 | u8 type_status; | ||
742 | #define IPR_PATH_CFG_TYPE_MASK 0xF0 | ||
743 | #define IPR_PATH_CFG_NOT_EXIST 0x00 | ||
744 | #define IPR_PATH_CFG_IOA_PORT 0x10 | ||
745 | #define IPR_PATH_CFG_EXP_PORT 0x20 | ||
746 | #define IPR_PATH_CFG_DEVICE_PORT 0x30 | ||
747 | #define IPR_PATH_CFG_DEVICE_LUN 0x40 | ||
748 | |||
749 | #define IPR_PATH_CFG_STATUS_MASK 0x0F | ||
750 | #define IPR_PATH_CFG_NO_PROB 0x00 | ||
751 | #define IPR_PATH_CFG_DEGRADED 0x01 | ||
752 | #define IPR_PATH_CFG_FAILED 0x02 | ||
753 | #define IPR_PATH_CFG_SUSPECT 0x03 | ||
754 | #define IPR_PATH_NOT_DETECTED 0x04 | ||
755 | #define IPR_PATH_INCORRECT_CONN 0x05 | ||
756 | |||
757 | u8 cascaded_expander; | ||
758 | u8 phy; | ||
759 | u8 link_rate; | ||
760 | #define IPR_PHY_LINK_RATE_MASK 0x0F | ||
761 | |||
762 | __be32 wwid[2]; | ||
763 | }__attribute__((packed, aligned (4))); | ||
764 | |||
765 | struct ipr_hostrcb_fabric_desc { | ||
766 | __be16 length; | ||
767 | u8 ioa_port; | ||
768 | u8 cascaded_expander; | ||
769 | u8 phy; | ||
770 | u8 path_state; | ||
771 | #define IPR_PATH_ACTIVE_MASK 0xC0 | ||
772 | #define IPR_PATH_NO_INFO 0x00 | ||
773 | #define IPR_PATH_ACTIVE 0x40 | ||
774 | #define IPR_PATH_NOT_ACTIVE 0x80 | ||
775 | |||
776 | #define IPR_PATH_STATE_MASK 0x0F | ||
777 | #define IPR_PATH_STATE_NO_INFO 0x00 | ||
778 | #define IPR_PATH_HEALTHY 0x01 | ||
779 | #define IPR_PATH_DEGRADED 0x02 | ||
780 | #define IPR_PATH_FAILED 0x03 | ||
781 | |||
782 | __be16 num_entries; | ||
783 | struct ipr_hostrcb_config_element elem[1]; | ||
784 | }__attribute__((packed, aligned (4))); | ||
785 | |||
786 | #define for_each_fabric_cfg(fabric, cfg) \ | ||
787 | for (cfg = (fabric)->elem; \ | ||
788 | cfg < ((fabric)->elem + be16_to_cpu((fabric)->num_entries)); \ | ||
789 | cfg++) | ||
790 | |||
791 | struct ipr_hostrcb_type_20_error { | ||
792 | u8 failure_reason[64]; | ||
793 | u8 reserved[3]; | ||
794 | u8 num_entries; | ||
795 | struct ipr_hostrcb_fabric_desc desc[1]; | ||
796 | }__attribute__((packed, aligned (4))); | ||
797 | |||
740 | struct ipr_hostrcb_error { | 798 | struct ipr_hostrcb_error { |
741 | __be32 failing_dev_ioasc; | 799 | __be32 failing_dev_ioasc; |
742 | struct ipr_res_addr failing_dev_res_addr; | 800 | struct ipr_res_addr failing_dev_res_addr; |
@@ -753,6 +811,7 @@ struct ipr_hostrcb_error { | |||
753 | struct ipr_hostrcb_type_13_error type_13_error; | 811 | struct ipr_hostrcb_type_13_error type_13_error; |
754 | struct ipr_hostrcb_type_14_error type_14_error; | 812 | struct ipr_hostrcb_type_14_error type_14_error; |
755 | struct ipr_hostrcb_type_17_error type_17_error; | 813 | struct ipr_hostrcb_type_17_error type_17_error; |
814 | struct ipr_hostrcb_type_20_error type_20_error; | ||
756 | } u; | 815 | } u; |
757 | }__attribute__((packed, aligned (4))); | 816 | }__attribute__((packed, aligned (4))); |
758 | 817 | ||
@@ -792,6 +851,7 @@ struct ipr_hcam { | |||
792 | #define IPR_HOST_RCB_OVERLAY_ID_14 0x14 | 851 | #define IPR_HOST_RCB_OVERLAY_ID_14 0x14 |
793 | #define IPR_HOST_RCB_OVERLAY_ID_16 0x16 | 852 | #define IPR_HOST_RCB_OVERLAY_ID_16 0x16 |
794 | #define IPR_HOST_RCB_OVERLAY_ID_17 0x17 | 853 | #define IPR_HOST_RCB_OVERLAY_ID_17 0x17 |
854 | #define IPR_HOST_RCB_OVERLAY_ID_20 0x20 | ||
795 | #define IPR_HOST_RCB_OVERLAY_ID_DEFAULT 0xFF | 855 | #define IPR_HOST_RCB_OVERLAY_ID_DEFAULT 0xFF |
796 | 856 | ||
797 | u8 reserved1[3]; | 857 | u8 reserved1[3]; |
@@ -811,6 +871,7 @@ struct ipr_hostrcb { | |||
811 | struct ipr_hcam hcam; | 871 | struct ipr_hcam hcam; |
812 | dma_addr_t hostrcb_dma; | 872 | dma_addr_t hostrcb_dma; |
813 | struct list_head queue; | 873 | struct list_head queue; |
874 | struct ipr_ioa_cfg *ioa_cfg; | ||
814 | }; | 875 | }; |
815 | 876 | ||
816 | /* IPR smart dump table structures */ | 877 | /* IPR smart dump table structures */ |
@@ -1289,6 +1350,17 @@ struct ipr_ucode_image_header { | |||
1289 | } \ | 1350 | } \ |
1290 | } | 1351 | } |
1291 | 1352 | ||
1353 | #define ipr_hcam_err(hostrcb, fmt, ...) \ | ||
1354 | { \ | ||
1355 | if (ipr_is_device(&(hostrcb)->hcam.u.error.failing_dev_res_addr)) { \ | ||
1356 | ipr_ra_err((hostrcb)->ioa_cfg, \ | ||
1357 | (hostrcb)->hcam.u.error.failing_dev_res_addr, \ | ||
1358 | fmt, ##__VA_ARGS__); \ | ||
1359 | } else { \ | ||
1360 | dev_err(&(hostrcb)->ioa_cfg->pdev->dev, fmt, ##__VA_ARGS__); \ | ||
1361 | } \ | ||
1362 | } | ||
1363 | |||
1292 | #define ipr_trace ipr_dbg("%s: %s: Line: %d\n",\ | 1364 | #define ipr_trace ipr_dbg("%s: %s: Line: %d\n",\ |
1293 | __FILE__, __FUNCTION__, __LINE__) | 1365 | __FILE__, __FUNCTION__, __LINE__) |
1294 | 1366 | ||