]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/qla4xxx/ql4_os.c
[SCSI] qla4xxx: Export more firmware info in sysfs
[karo-tx-linux.git] / drivers / scsi / qla4xxx / ql4_os.c
index bfee27e5786b30469119dd3b48d603ed575962bd..6226df61a354c8fbc9a723319cb0a3f1f483b679 100644 (file)
@@ -5707,7 +5707,8 @@ static int qla4xxx_sysfs_ddb_add(struct Scsi_Host *shost, const char *buf,
                goto exit_ddb_add;
        }
 
-       for (idx = 0; idx < max_ddbs; idx++) {
+       /* Index 0 and 1 are reserved for boot target entries */
+       for (idx = 2; idx < max_ddbs; idx++) {
                if (qla4xxx_flashdb_by_index(ha, fw_ddb_entry,
                                             fw_ddb_entry_dma, idx))
                        break;
@@ -6235,7 +6236,7 @@ qla4xxx_sysfs_ddb_get_param(struct iscsi_bus_flash_session *fnode_sess,
        struct iscsi_bus_flash_conn *fnode_conn;
        struct ql4_chap_table chap_tbl;
        struct device *dev;
-       int parent_type, parent_index = 0xffff;
+       int parent_type;
        int rc = 0;
 
        dev = iscsi_find_flashnode_conn(fnode_sess);
@@ -6401,10 +6402,7 @@ qla4xxx_sysfs_ddb_get_param(struct iscsi_bus_flash_session *fnode_sess,
                        rc = sprintf(buf, "\n");
                break;
        case ISCSI_FLASHNODE_DISCOVERY_PARENT_IDX:
-               if (fnode_sess->discovery_parent_idx < MAX_DDB_ENTRIES)
-                       parent_index = fnode_sess->discovery_parent_idx;
-
-               rc = sprintf(buf, "%u\n", parent_index);
+               rc = sprintf(buf, "%u\n", fnode_sess->discovery_parent_idx);
                break;
        case ISCSI_FLASHNODE_DISCOVERY_PARENT_TYPE:
                if (fnode_sess->discovery_parent_type == DDB_ISNS)
@@ -7222,8 +7220,8 @@ skip_retry_init:
               " QLogic iSCSI HBA Driver version: %s\n"
               "  QLogic ISP%04x @ %s, host#=%ld, fw=%02d.%02d.%02d.%02d\n",
               qla4xxx_version_str, ha->pdev->device, pci_name(ha->pdev),
-              ha->host_no, ha->firmware_version[0], ha->firmware_version[1],
-              ha->patch_number, ha->build_number);
+              ha->host_no, ha->fw_info.fw_major, ha->fw_info.fw_minor,
+              ha->fw_info.fw_patch, ha->fw_info.fw_build);
 
        /* Set the driver version */
        if (is_qla80XX(ha))