if (bbcr.status == QLA_BBCR_STATUS_ENABLED) {
rval = qla2x00_get_adapter_id(vha, &loop_id, &al_pa,
&area, &domain, &topo, &sw_cap);
- if (rval != QLA_SUCCESS)
- return -EIO;
+ if (rval != QLA_SUCCESS) {
+ bbcr.status = QLA_BBCR_STATUS_UNKNOWN;
+ bbcr.state = QLA_BBCR_STATE_OFFLINE;
+ bbcr.mbx1 = loop_id;
+ goto done;
+ }
state = (vha->bbcr >> 12) & 0x1;
bbcr.configured_bbscn = vha->bbcr & 0xf;
}
+done:
sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
bsg_job->reply_payload.sg_cnt, &bbcr, sizeof(bbcr));
bsg_job->reply->reply_payload_rcv_len = sizeof(bbcr);
/* BB_CR Status */
#define QLA_BBCR_STATUS_DISABLED 0
#define QLA_BBCR_STATUS_ENABLED 1
+#define QLA_BBCR_STATUS_UNKNOWN 2
/* BB_CR State */
#define QLA_BBCR_STATE_OFFLINE 0
uint8_t configured_bbscn; /* 0-15 */
uint8_t negotiated_bbscn; /* 0-15 */
uint8_t offline_reason_code;
- uint8_t reserved[11];
+ uint16_t mbx1; /* Port state */
+ uint8_t reserved[9];
} __packed;
#endif