sr: fx2lafw: Only check for correct major FW version.

Changes in the minor version number are OK, as those should never
contain any incompatible/API changes.
This commit is contained in:
Uwe Hermann 2012-05-30 23:15:23 +02:00
parent 8fdecced96
commit 0a8c0c324e
2 changed files with 10 additions and 7 deletions

View File

@ -251,11 +251,15 @@ static int fx2lafw_dev_open(int dev_index)
break;
}
if (vi.major != FX2LAFW_VERSION_MAJOR ||
vi.minor != FX2LAFW_VERSION_MINOR) {
sr_err("fx2lafw: Expected firmware version %d.%d "
"got %d.%d.", FX2LAFW_VERSION_MAJOR,
FX2LAFW_VERSION_MINOR, vi.major, vi.minor);
/*
* Changes in major version mean incompatible/API changes, so
* bail out if we encounter an incompatible version.
* Different minor versions are OK, they should be compatible.
*/
if (vi.major != FX2LAFW_REQUIRED_VERSION_MAJOR) {
sr_err("fx2lafw: Expected firmware version %d.x, "
"got %d.%d.", FX2LAFW_REQUIRED_VERSION_MAJOR,
vi.major, vi.minor);
break;
}

View File

@ -31,8 +31,7 @@
#define NUM_SIMUL_TRANSFERS 32
#define MAX_EMPTY_TRANSFERS (NUM_SIMUL_TRANSFERS * 2)
#define FX2LAFW_VERSION_MAJOR 1
#define FX2LAFW_VERSION_MINOR 0
#define FX2LAFW_REQUIRED_VERSION_MAJOR 1
/* 6 delay states of up to 256 clock ticks */
#define MAX_SAMPLE_DELAY (6 * 256)