summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2021-07-28 17:27:07 -0700
committerGitHub <noreply@github.com>2021-07-28 17:27:07 -0700
commit7970603e5210a8c062534bd2d6a1e06166d8f010 (patch)
tree6d8fa9da519eef67aaf4e5ed872a1a46b4d189e7
parent40ece0cae611d59061837fd423819cbe6628dacf (diff)
parent2725428566d58c19808d86256a80db2ff58446ad (diff)
downloadopen-iscsi-7970603e5210a8c062534bd2d6a1e06166d8f010.tar.gz
Merge pull request #266 from manishrangankar/iscsiuio-fixes
bnx2x.c: Re-initialize bp->version with baseline version.
-rw-r--r--iscsiuio/src/unix/libs/bnx2x.c19
-rw-r--r--iscsiuio/src/unix/libs/bnx2x.h3
2 files changed, 19 insertions, 3 deletions
diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c
index 0e326d4..7481e86 100644
--- a/iscsiuio/src/unix/libs/bnx2x.c
+++ b/iscsiuio/src/unix/libs/bnx2x.c
@@ -350,6 +350,13 @@ static int bnx2x_is_drv_version_unknown(struct bnx2x_driver_version *version)
return 0;
}
+static void bnx2x_set_drv_version_default(bnx2x_t *bp)
+{
+ bp->version.major = BNX2X_DEFAULT_MAJOR_VERSION;
+ bp->version.minor = BNX2X_DEFAULT_MINOR_VERSION;
+ bp->version.sub_minor = BNX2X_DEFAULT_SUB_MINOR_VERSION;
+}
+
/**
* bnx2x_get_drv_version() - Used to determine the driver version
* @param bp - Device used to determine bnx2x driver version
@@ -405,8 +412,7 @@ static int bnx2x_get_drv_version(bnx2x_t *bp)
}
bp->version.sub_minor = atoi(tok);
- LOG_INFO(PFX "%s: bnx2x driver using version %d.%d.%d",
- nic->log_name,
+ LOG_INFO(PFX "%s: interface version %d.%d.%d", nic->log_name,
bp->version.major, bp->version.minor, bp->version.sub_minor);
close(fd);
@@ -710,7 +716,14 @@ static int bnx2x_open(nic_t *nic)
/* If version is unknown, go read from ethtool */
rc = bnx2x_get_drv_version(bp);
if (rc)
- goto open_error;
+ bnx2x_set_drv_version_default(bp);
+ else if (!(bnx2x_is_ver60_plus(bp) || bnx2x_is_ver52(bp)))
+ bnx2x_set_drv_version_default(bp);
+
+ LOG_INFO(PFX "%s: bnx2x Use baseline version %d.%d.%d",
+ nic->log_name,
+ bp->version.major, bp->version.minor,
+ bp->version.sub_minor);
} else {
/* Version is not unknown, just use it */
bnx2x_version.major = bp->version.major;
diff --git a/iscsiuio/src/unix/libs/bnx2x.h b/iscsiuio/src/unix/libs/bnx2x.h
index ce55cfc..e204cbb 100644
--- a/iscsiuio/src/unix/libs/bnx2x.h
+++ b/iscsiuio/src/unix/libs/bnx2x.h
@@ -615,6 +615,9 @@ struct ustorm_eth_rx_producers {
__u16 reserved;
};
+#define BNX2X_DEFAULT_MAJOR_VERSION 1
+#define BNX2X_DEFAULT_MINOR_VERSION 70
+#define BNX2X_DEFAULT_SUB_MINOR_VERSION 1
#define BNX2X_UNKNOWN_MAJOR_VERSION -1
#define BNX2X_UNKNOWN_MINOR_VERSION -1
#define BNX2X_UNKNOWN_SUB_MINOR_VERSION -1