Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13919
b: refs/heads/master
c: cfc3213
h: refs/heads/master
i:
  13917: 0bf29c1
  13915: 86b557c
  13911: 4af3fde
  13903: 2d97c60
  13887: d151fb0
v: v3
  • Loading branch information
brking@us.ibm.com authored and James Bottomley committed Nov 6, 2005
1 parent 36dcaed commit f1ef370
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 54 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 11cd8f120173a707e9ed7b78f7af8cde5a1ebb90
refs/heads/master: cfc321397e9e309a8148c18c32ade26ac40be39d
37 changes: 16 additions & 21 deletions trunk/drivers/scsi/ipr.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,24 +889,23 @@ static void ipr_process_ccn(struct ipr_cmnd *ipr_cmd)

/**
* ipr_log_vpd - Log the passed VPD to the error log.
* @vpids: vendor/product id struct
* @serial_num: serial number string
* @vpd: vendor/product id/sn struct
*
* Return value:
* none
**/
static void ipr_log_vpd(struct ipr_std_inq_vpids *vpids, u8 *serial_num)
static void ipr_log_vpd(struct ipr_vpd *vpd)
{
char buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN
+ IPR_SERIAL_NUM_LEN];

memcpy(buffer, vpids->vendor_id, IPR_VENDOR_ID_LEN);
memcpy(buffer + IPR_VENDOR_ID_LEN, vpids->product_id,
memcpy(buffer, vpd->vpids.vendor_id, IPR_VENDOR_ID_LEN);
memcpy(buffer + IPR_VENDOR_ID_LEN, vpd->vpids.product_id,
IPR_PROD_ID_LEN);
buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN] = '\0';
ipr_err("Vendor/Product ID: %s\n", buffer);

memcpy(buffer, serial_num, IPR_SERIAL_NUM_LEN);
memcpy(buffer, vpd->sn, IPR_SERIAL_NUM_LEN);
buffer[IPR_SERIAL_NUM_LEN] = '\0';
ipr_err(" Serial Number: %s\n", buffer);
}
Expand All @@ -927,17 +926,15 @@ static void ipr_log_cache_error(struct ipr_ioa_cfg *ioa_cfg,

ipr_err("-----Current Configuration-----\n");
ipr_err("Cache Directory Card Information:\n");
ipr_log_vpd(&error->ioa_vpids, error->ioa_sn);
ipr_log_vpd(&error->ioa_vpd);
ipr_err("Adapter Card Information:\n");
ipr_log_vpd(&error->cfc_vpids, error->cfc_sn);
ipr_log_vpd(&error->cfc_vpd);

ipr_err("-----Expected Configuration-----\n");
ipr_err("Cache Directory Card Information:\n");
ipr_log_vpd(&error->ioa_last_attached_to_cfc_vpids,
error->ioa_last_attached_to_cfc_sn);
ipr_log_vpd(&error->ioa_last_attached_to_cfc_vpd);
ipr_err("Adapter Card Information:\n");
ipr_log_vpd(&error->cfc_last_attached_to_ioa_vpids,
error->cfc_last_attached_to_ioa_sn);
ipr_log_vpd(&error->cfc_last_attached_to_ioa_vpd);

ipr_err("Additional IOA Data: %08X %08X %08X\n",
be32_to_cpu(error->ioa_data[0]),
Expand Down Expand Up @@ -966,7 +963,7 @@ static void ipr_log_config_error(struct ipr_ioa_cfg *ioa_cfg,
ipr_err("Device Errors Detected/Logged: %d/%d\n",
be32_to_cpu(error->errors_detected), errors_logged);

dev_entry = error->dev_entry;
dev_entry = error->dev;

for (i = 0; i < errors_logged; i++, dev_entry++) {
ipr_err_separator;
Expand All @@ -978,18 +975,16 @@ static void ipr_log_config_error(struct ipr_ioa_cfg *ioa_cfg,
ioa_cfg->host->host_no, dev_entry->dev_res_addr.bus,
dev_entry->dev_res_addr.target, dev_entry->dev_res_addr.lun);
}
ipr_log_vpd(&dev_entry->dev_vpids, dev_entry->dev_sn);
ipr_log_vpd(&dev_entry->vpd);

ipr_err("-----New Device Information-----\n");
ipr_log_vpd(&dev_entry->new_dev_vpids, dev_entry->new_dev_sn);
ipr_log_vpd(&dev_entry->new_vpd);

ipr_err("Cache Directory Card Information:\n");
ipr_log_vpd(&dev_entry->ioa_last_with_dev_vpids,
dev_entry->ioa_last_with_dev_sn);
ipr_log_vpd(&dev_entry->ioa_last_with_dev_vpd);

ipr_err("Adapter Card Information:\n");
ipr_log_vpd(&dev_entry->cfc_last_with_dev_vpids,
dev_entry->cfc_last_with_dev_sn);
ipr_log_vpd(&dev_entry->cfc_last_with_dev_vpd);

ipr_err("Additional IOA Data: %08X %08X %08X %08X %08X\n",
be32_to_cpu(dev_entry->ioa_data[0]),
Expand Down Expand Up @@ -1032,7 +1027,7 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg,
array_entry = error->array_member;

for (i = 0; i < 18; i++) {
if (!memcmp(array_entry->serial_num, zero_sn, IPR_SERIAL_NUM_LEN))
if (!memcmp(array_entry->vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN))
continue;

if (be32_to_cpu(error->exposed_mode_adn) == i) {
Expand All @@ -1041,7 +1036,7 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg,
ipr_err("Array Member %d:\n", i);
}

ipr_log_vpd(&array_entry->vpids, array_entry->serial_num);
ipr_log_vpd(&array_entry->vpd);

if (array_entry->dev_res_addr.bus >= IPR_MAX_NUM_BUSES) {
ipr_err("Current Location: unknown\n");
Expand Down
52 changes: 20 additions & 32 deletions trunk/drivers/scsi/ipr.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ struct ipr_std_inq_vpids {
u8 product_id[IPR_PROD_ID_LEN];
}__attribute__((packed));

struct ipr_vpd {
struct ipr_std_inq_vpids vpids;
u8 sn[IPR_SERIAL_NUM_LEN];
}__attribute__((packed));

struct ipr_std_inq_data {
u8 peri_qual_dev_type;
#define IPR_STD_INQ_PERI_QUAL(peri) ((peri) >> 5)
Expand Down Expand Up @@ -537,21 +542,16 @@ struct ipr_inquiry_page3 {
}__attribute__((packed));

struct ipr_hostrcb_device_data_entry {
struct ipr_std_inq_vpids dev_vpids;
u8 dev_sn[IPR_SERIAL_NUM_LEN];
struct ipr_vpd vpd;
struct ipr_res_addr dev_res_addr;
struct ipr_std_inq_vpids new_dev_vpids;
u8 new_dev_sn[IPR_SERIAL_NUM_LEN];
struct ipr_std_inq_vpids ioa_last_with_dev_vpids;
u8 ioa_last_with_dev_sn[IPR_SERIAL_NUM_LEN];
struct ipr_std_inq_vpids cfc_last_with_dev_vpids;
u8 cfc_last_with_dev_sn[IPR_SERIAL_NUM_LEN];
struct ipr_vpd new_vpd;
struct ipr_vpd ioa_last_with_dev_vpd;
struct ipr_vpd cfc_last_with_dev_vpd;
__be32 ioa_data[5];
}__attribute__((packed, aligned (4)));

struct ipr_hostrcb_array_data_entry {
struct ipr_std_inq_vpids vpids;
u8 serial_num[IPR_SERIAL_NUM_LEN];
struct ipr_vpd vpd;
struct ipr_res_addr expected_dev_res_addr;
struct ipr_res_addr dev_res_addr;
}__attribute__((packed, aligned (4)));
Expand All @@ -568,47 +568,35 @@ struct ipr_hostrcb_type_01_error {
}__attribute__((packed, aligned (4)));

struct ipr_hostrcb_type_02_error {
struct ipr_std_inq_vpids ioa_vpids;
u8 ioa_sn[IPR_SERIAL_NUM_LEN];
struct ipr_std_inq_vpids cfc_vpids;
u8 cfc_sn[IPR_SERIAL_NUM_LEN];
struct ipr_std_inq_vpids ioa_last_attached_to_cfc_vpids;
u8 ioa_last_attached_to_cfc_sn[IPR_SERIAL_NUM_LEN];
struct ipr_std_inq_vpids cfc_last_attached_to_ioa_vpids;
u8 cfc_last_attached_to_ioa_sn[IPR_SERIAL_NUM_LEN];
struct ipr_vpd ioa_vpd;
struct ipr_vpd cfc_vpd;
struct ipr_vpd ioa_last_attached_to_cfc_vpd;
struct ipr_vpd cfc_last_attached_to_ioa_vpd;
__be32 ioa_data[3];
u8 reserved[844];
}__attribute__((packed, aligned (4)));

struct ipr_hostrcb_type_03_error {
struct ipr_std_inq_vpids ioa_vpids;
u8 ioa_sn[IPR_SERIAL_NUM_LEN];
struct ipr_std_inq_vpids cfc_vpids;
u8 cfc_sn[IPR_SERIAL_NUM_LEN];
struct ipr_vpd ioa_vpd;
struct ipr_vpd cfc_vpd;
__be32 errors_detected;
__be32 errors_logged;
u8 ioa_data[12];
struct ipr_hostrcb_device_data_entry dev_entry[3];
u8 reserved[444];
struct ipr_hostrcb_device_data_entry dev[3];
}__attribute__((packed, aligned (4)));

struct ipr_hostrcb_type_04_error {
struct ipr_std_inq_vpids ioa_vpids;
u8 ioa_sn[IPR_SERIAL_NUM_LEN];
struct ipr_std_inq_vpids cfc_vpids;
u8 cfc_sn[IPR_SERIAL_NUM_LEN];
struct ipr_vpd ioa_vpd;
struct ipr_vpd cfc_vpd;
u8 ioa_data[12];
struct ipr_hostrcb_array_data_entry array_member[10];
__be32 exposed_mode_adn;
__be32 array_id;
struct ipr_std_inq_vpids incomp_dev_vpids;
u8 incomp_dev_sn[IPR_SERIAL_NUM_LEN];
struct ipr_vpd incomp_dev_vpd;
__be32 ioa_data2;
struct ipr_hostrcb_array_data_entry array_member2[8];
struct ipr_res_addr last_func_vset_res_addr;
u8 vset_serial_num[IPR_SERIAL_NUM_LEN];
u8 protection_level[8];
u8 reserved[124];
}__attribute__((packed, aligned (4)));

struct ipr_hostrcb_error {
Expand Down

0 comments on commit f1ef370

Please sign in to comment.