diff options
author | brking@us.ibm.com <brking@us.ibm.com> | 2005-11-01 18:00:18 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-11-06 13:59:53 -0500 |
commit | cfc321397e9e309a8148c18c32ade26ac40be39d (patch) | |
tree | 2fddc675dc4d3d9bceb32dc84403004892fbf4e8 /drivers/scsi/ipr.c | |
parent | 11cd8f120173a707e9ed7b78f7af8cde5a1ebb90 (diff) |
[SCSI] ipr: Cleanup error structures
Simplify the ipr error structures a bit by removing some duplication.
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r-- | drivers/scsi/ipr.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index da61ce1998c3..d5da5e5c4c6d 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -889,24 +889,23 @@ static void ipr_process_ccn(struct ipr_cmnd *ipr_cmd) | |||
889 | 889 | ||
890 | /** | 890 | /** |
891 | * ipr_log_vpd - Log the passed VPD to the error log. | 891 | * ipr_log_vpd - Log the passed VPD to the error log. |
892 | * @vpids: vendor/product id struct | 892 | * @vpd: vendor/product id/sn struct |
893 | * @serial_num: serial number string | ||
894 | * | 893 | * |
895 | * Return value: | 894 | * Return value: |
896 | * none | 895 | * none |
897 | **/ | 896 | **/ |
898 | static void ipr_log_vpd(struct ipr_std_inq_vpids *vpids, u8 *serial_num) | 897 | static void ipr_log_vpd(struct ipr_vpd *vpd) |
899 | { | 898 | { |
900 | char buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN | 899 | char buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN |
901 | + IPR_SERIAL_NUM_LEN]; | 900 | + IPR_SERIAL_NUM_LEN]; |
902 | 901 | ||
903 | memcpy(buffer, vpids->vendor_id, IPR_VENDOR_ID_LEN); | 902 | memcpy(buffer, vpd->vpids.vendor_id, IPR_VENDOR_ID_LEN); |
904 | memcpy(buffer + IPR_VENDOR_ID_LEN, vpids->product_id, | 903 | memcpy(buffer + IPR_VENDOR_ID_LEN, vpd->vpids.product_id, |
905 | IPR_PROD_ID_LEN); | 904 | IPR_PROD_ID_LEN); |
906 | buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN] = '\0'; | 905 | buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN] = '\0'; |
907 | ipr_err("Vendor/Product ID: %s\n", buffer); | 906 | ipr_err("Vendor/Product ID: %s\n", buffer); |
908 | 907 | ||
909 | memcpy(buffer, serial_num, IPR_SERIAL_NUM_LEN); | 908 | memcpy(buffer, vpd->sn, IPR_SERIAL_NUM_LEN); |
910 | buffer[IPR_SERIAL_NUM_LEN] = '\0'; | 909 | buffer[IPR_SERIAL_NUM_LEN] = '\0'; |
911 | ipr_err(" Serial Number: %s\n", buffer); | 910 | ipr_err(" Serial Number: %s\n", buffer); |
912 | } | 911 | } |
@@ -927,17 +926,15 @@ static void ipr_log_cache_error(struct ipr_ioa_cfg *ioa_cfg, | |||
927 | 926 | ||
928 | ipr_err("-----Current Configuration-----\n"); | 927 | ipr_err("-----Current Configuration-----\n"); |
929 | ipr_err("Cache Directory Card Information:\n"); | 928 | ipr_err("Cache Directory Card Information:\n"); |
930 | ipr_log_vpd(&error->ioa_vpids, error->ioa_sn); | 929 | ipr_log_vpd(&error->ioa_vpd); |
931 | ipr_err("Adapter Card Information:\n"); | 930 | ipr_err("Adapter Card Information:\n"); |
932 | ipr_log_vpd(&error->cfc_vpids, error->cfc_sn); | 931 | ipr_log_vpd(&error->cfc_vpd); |
933 | 932 | ||
934 | ipr_err("-----Expected Configuration-----\n"); | 933 | ipr_err("-----Expected Configuration-----\n"); |
935 | ipr_err("Cache Directory Card Information:\n"); | 934 | ipr_err("Cache Directory Card Information:\n"); |
936 | ipr_log_vpd(&error->ioa_last_attached_to_cfc_vpids, | 935 | ipr_log_vpd(&error->ioa_last_attached_to_cfc_vpd); |
937 | error->ioa_last_attached_to_cfc_sn); | ||
938 | ipr_err("Adapter Card Information:\n"); | 936 | ipr_err("Adapter Card Information:\n"); |
939 | ipr_log_vpd(&error->cfc_last_attached_to_ioa_vpids, | 937 | ipr_log_vpd(&error->cfc_last_attached_to_ioa_vpd); |
940 | error->cfc_last_attached_to_ioa_sn); | ||
941 | 938 | ||
942 | ipr_err("Additional IOA Data: %08X %08X %08X\n", | 939 | ipr_err("Additional IOA Data: %08X %08X %08X\n", |
943 | be32_to_cpu(error->ioa_data[0]), | 940 | be32_to_cpu(error->ioa_data[0]), |
@@ -966,7 +963,7 @@ static void ipr_log_config_error(struct ipr_ioa_cfg *ioa_cfg, | |||
966 | ipr_err("Device Errors Detected/Logged: %d/%d\n", | 963 | ipr_err("Device Errors Detected/Logged: %d/%d\n", |
967 | be32_to_cpu(error->errors_detected), errors_logged); | 964 | be32_to_cpu(error->errors_detected), errors_logged); |
968 | 965 | ||
969 | dev_entry = error->dev_entry; | 966 | dev_entry = error->dev; |
970 | 967 | ||
971 | for (i = 0; i < errors_logged; i++, dev_entry++) { | 968 | for (i = 0; i < errors_logged; i++, dev_entry++) { |
972 | ipr_err_separator; | 969 | ipr_err_separator; |
@@ -978,18 +975,16 @@ static void ipr_log_config_error(struct ipr_ioa_cfg *ioa_cfg, | |||
978 | ioa_cfg->host->host_no, dev_entry->dev_res_addr.bus, | 975 | ioa_cfg->host->host_no, dev_entry->dev_res_addr.bus, |
979 | dev_entry->dev_res_addr.target, dev_entry->dev_res_addr.lun); | 976 | dev_entry->dev_res_addr.target, dev_entry->dev_res_addr.lun); |
980 | } | 977 | } |
981 | ipr_log_vpd(&dev_entry->dev_vpids, dev_entry->dev_sn); | 978 | ipr_log_vpd(&dev_entry->vpd); |
982 | 979 | ||
983 | ipr_err("-----New Device Information-----\n"); | 980 | ipr_err("-----New Device Information-----\n"); |
984 | ipr_log_vpd(&dev_entry->new_dev_vpids, dev_entry->new_dev_sn); | 981 | ipr_log_vpd(&dev_entry->new_vpd); |
985 | 982 | ||
986 | ipr_err("Cache Directory Card Information:\n"); | 983 | ipr_err("Cache Directory Card Information:\n"); |
987 | ipr_log_vpd(&dev_entry->ioa_last_with_dev_vpids, | 984 | ipr_log_vpd(&dev_entry->ioa_last_with_dev_vpd); |
988 | dev_entry->ioa_last_with_dev_sn); | ||
989 | 985 | ||
990 | ipr_err("Adapter Card Information:\n"); | 986 | ipr_err("Adapter Card Information:\n"); |
991 | ipr_log_vpd(&dev_entry->cfc_last_with_dev_vpids, | 987 | ipr_log_vpd(&dev_entry->cfc_last_with_dev_vpd); |
992 | dev_entry->cfc_last_with_dev_sn); | ||
993 | 988 | ||
994 | ipr_err("Additional IOA Data: %08X %08X %08X %08X %08X\n", | 989 | ipr_err("Additional IOA Data: %08X %08X %08X %08X %08X\n", |
995 | be32_to_cpu(dev_entry->ioa_data[0]), | 990 | be32_to_cpu(dev_entry->ioa_data[0]), |
@@ -1032,7 +1027,7 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1032 | array_entry = error->array_member; | 1027 | array_entry = error->array_member; |
1033 | 1028 | ||
1034 | for (i = 0; i < 18; i++) { | 1029 | for (i = 0; i < 18; i++) { |
1035 | if (!memcmp(array_entry->serial_num, zero_sn, IPR_SERIAL_NUM_LEN)) | 1030 | if (!memcmp(array_entry->vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN)) |
1036 | continue; | 1031 | continue; |
1037 | 1032 | ||
1038 | if (be32_to_cpu(error->exposed_mode_adn) == i) { | 1033 | if (be32_to_cpu(error->exposed_mode_adn) == i) { |
@@ -1041,7 +1036,7 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1041 | ipr_err("Array Member %d:\n", i); | 1036 | ipr_err("Array Member %d:\n", i); |
1042 | } | 1037 | } |
1043 | 1038 | ||
1044 | ipr_log_vpd(&array_entry->vpids, array_entry->serial_num); | 1039 | ipr_log_vpd(&array_entry->vpd); |
1045 | 1040 | ||
1046 | if (array_entry->dev_res_addr.bus >= IPR_MAX_NUM_BUSES) { | 1041 | if (array_entry->dev_res_addr.bus >= IPR_MAX_NUM_BUSES) { |
1047 | ipr_err("Current Location: unknown\n"); | 1042 | ipr_err("Current Location: unknown\n"); |