Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271111
b: refs/heads/master
c: 8de5b95
h: refs/heads/master
i:
  271109: 04a0854
  271107: 453f73e
  271103: c09c955
v: v3
  • Loading branch information
Lalit Chandivade authored and James Bottomley committed Oct 16, 2011
1 parent b3cfdb0 commit 8796c3b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 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: 4549415af6915017f5d3fbdbfd5edd1dfbe63fa9
refs/heads/master: 8de5b9582420acac5129ec7921711aded75406c0
37 changes: 21 additions & 16 deletions trunk/drivers/scsi/qla4xxx/ql4_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -2812,15 +2812,11 @@ static int get_fw_boot_info(struct scsi_qla_host *ha, uint16_t ddb_index[])
val = rd_nvram_byte(ha, pri_addr);
if (val & BIT_7)
ddb_index[0] = (val & 0x7f);
else
ddb_index[0] = 0;

/* get secondary valid target index */
val = rd_nvram_byte(ha, sec_addr);
if (val & BIT_7)
ddb_index[1] = (val & 0x7f);
else
ddb_index[1] = 1;

} else if (is_qla8022(ha)) {
buf = dma_alloc_coherent(&ha->pdev->dev, size,
Expand Down Expand Up @@ -2862,15 +2858,10 @@ static int get_fw_boot_info(struct scsi_qla_host *ha, uint16_t ddb_index[])
/* get primary valid target index */
if (buf[2] & BIT_7)
ddb_index[0] = buf[2] & 0x7f;
else
ddb_index[0] = 0;

/* get secondary valid target index */
if (buf[11] & BIT_7)
ddb_index[1] = buf[11] & 0x7f;
else
ddb_index[1] = 1;

} else {
ret = QLA_ERROR;
goto exit_boot_info;
Expand Down Expand Up @@ -2980,29 +2971,43 @@ static int qla4xxx_get_boot_target(struct scsi_qla_host *ha,
static int qla4xxx_get_boot_info(struct scsi_qla_host *ha)
{
uint16_t ddb_index[2];
int ret = QLA_SUCCESS;
int ret = QLA_ERROR;
int rval;

memset(ddb_index, 0, sizeof(ddb_index));
ddb_index[0] = 0xffff;
ddb_index[1] = 0xffff;
ret = get_fw_boot_info(ha, ddb_index);
if (ret != QLA_SUCCESS) {
DEBUG2(ql4_printk(KERN_ERR, ha,
"%s: Failed to set boot info.\n", __func__));
return ret;
}

ret = qla4xxx_get_boot_target(ha, &(ha->boot_tgt.boot_pri_sess),
if (ddb_index[0] == 0xffff)
goto sec_target;

rval = qla4xxx_get_boot_target(ha, &(ha->boot_tgt.boot_pri_sess),
ddb_index[0]);
if (ret != QLA_SUCCESS) {
if (rval != QLA_SUCCESS) {
DEBUG2(ql4_printk(KERN_ERR, ha, "%s: Failed to get "
"primary target\n", __func__));
}
} else
ret = QLA_SUCCESS;

ret = qla4xxx_get_boot_target(ha, &(ha->boot_tgt.boot_sec_sess),
sec_target:
if (ddb_index[1] == 0xffff)
goto exit_get_boot_info;

rval = qla4xxx_get_boot_target(ha, &(ha->boot_tgt.boot_sec_sess),
ddb_index[1]);
if (ret != QLA_SUCCESS) {
if (rval != QLA_SUCCESS) {
DEBUG2(ql4_printk(KERN_ERR, ha, "%s: Failed to get "
"secondary target\n", __func__));
}
} else
ret = QLA_SUCCESS;

exit_get_boot_info:
return ret;
}

Expand Down

0 comments on commit 8796c3b

Please sign in to comment.