+ ret = command_get_fw_version(ctx->usb->devhdl, &vi);
+ if (ret != SR_OK) {
+ sr_err("fx2lafw: Failed to retrieve "
+ "firmware version information.");
+ break;
+ }
+
+ ret = command_get_revid_version(ctx->usb->devhdl, &revid);
+ if (ret != SR_OK) {
+ sr_err("fx2lafw: Failed to retrieve REVID.");
+ break;
+ }
+
+ /*
+ * 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;
+ }
+
+ sdi->status = SR_ST_ACTIVE;
+ sr_info("fx2lafw: Opened device %d on %d.%d "
+ "interface %d, firmware %d.%d, REVID %d.",
+ sdi->index, ctx->usb->bus, ctx->usb->address,
+ USB_INTERFACE, vi.major, vi.minor, revid);
+