int i, ret, num_valid;
uint8_t *bcode;
struct qla_fcp_prio_entry *pri_entry;
+ uint32_t *bcode_val_ptr, bcode_val;
ret = 1;
num_valid = 0;
bcode = (uint8_t *)pri_cfg;
+ bcode_val_ptr = (uint32_t *)pri_cfg;
+ bcode_val = (uint32_t)(*bcode_val_ptr);
- if (bcode[0x0] != 'H' || bcode[0x1] != 'Q' || bcode[0x2] != 'O' ||
- bcode[0x3] != 'S') {
+ if (bcode_val == 0xFFFFFFFF) {
+ /* No FCP Priority config data in flash */
+ DEBUG2(printk(KERN_INFO
+ "%s: No FCP priority config data.\n",
+ __func__));
+ return 0;
+ }
+
+ if (bcode[0] != 'H' || bcode[1] != 'Q' || bcode[2] != 'O' ||
+ bcode[3] != 'S') {
+ /* Invalid FCP priority data header*/
+ DEBUG2(printk(KERN_ERR
+ "%s: Invalid FCP Priority data header. bcode=0x%x\n",
+ __func__, bcode_val));
return 0;
}
if (flag != 1)
pri_entry++;
}
- if (num_valid == 0)
+ if (num_valid == 0) {
+ /* No valid FCP priority data entries */
+ DEBUG2(printk(KERN_ERR
+ "%s: No valid FCP Priority data entries.\n",
+ __func__));
ret = 0;
+ } else {
+ /* FCP priority data is valid */
+ DEBUG2(printk(KERN_INFO
+ "%s: Valid FCP priority data. num entries = %d\n",
+ __func__, num_valid));
+ }
return ret;
}
bsg_job->reply->reply_payload_rcv_len = 0;
+ if (!IS_QLA24XX_TYPE(ha) || !IS_QLA25XX(ha)) {
+ ret = -EINVAL;
+ goto exit_fcp_prio_cfg;
+ }
+
if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
struct qla_hw_data *ha = vha->hw;
struct req_que *req = ha->req_q_map[0];
+ def = 0;
+ if (IS_QLA25XX(ha))
+ def = 1;
+ else if (IS_QLA81XX(ha))
+ def = 2;
ha->flt_region_flt = flt_addr;
wptr = (uint16_t *)req->ring;
flt = (struct qla_flt_header *)req->ring;
goto no_flash_data;
}
+ /* Assign FCP prio region since older FLT's may not have it */
+ ha->flt_region_fcp_prio = ha->flags.port0 ?
+ fcp_prio_cfg0[def] : fcp_prio_cfg1[def];
+
loc = locations[1];
cnt = le16_to_cpu(flt->length) / sizeof(struct qla_flt_region);
for ( ; cnt; cnt--, region++) {
no_flash_data:
/* Use hardcoded defaults. */
loc = locations[0];
- def = 0;
- if (IS_QLA24XX_TYPE(ha))
- def = 0;
- else if (IS_QLA25XX(ha))
- def = 1;
- else if (IS_QLA81XX(ha))
- def = 2;
ha->flt_region_fw = def_fw[def];
ha->flt_region_boot = def_boot[def];
ha->flt_region_vpd_nvram = def_vpd_nvram[def];
ha->flt_region_fdt = def_fdt[def];
ha->flt_region_npiv_conf = ha->flags.port0 ?
def_npiv_conf0[def] : def_npiv_conf1[def];
- ha->flt_region_fcp_prio = ha->flags.port0 ?
- fcp_prio_cfg0[def] : fcp_prio_cfg1[def];
done:
DEBUG2(qla_printk(KERN_DEBUG, ha, "FLT[%s]: boot=0x%x fw=0x%x "
"vpd_nvram=0x%x vpd=0x%x nvram=0x%x fdt=0x%x flt=0x%x "
- "npiv=0x%x.\n", loc, ha->flt_region_boot, ha->flt_region_fw,
- ha->flt_region_vpd_nvram, ha->flt_region_vpd, ha->flt_region_nvram,
- ha->flt_region_fdt, ha->flt_region_flt, ha->flt_region_npiv_conf));
+ "npiv=0x%x. fcp_prio_cfg=0x%x\n", loc, ha->flt_region_boot,
+ ha->flt_region_fw, ha->flt_region_vpd_nvram, ha->flt_region_vpd,
+ ha->flt_region_nvram, ha->flt_region_fdt, ha->flt_region_flt,
+ ha->flt_region_npiv_conf, ha->flt_region_fcp_prio));
}
static void