+ if (!fx2_prof)
+ /* not a supported VID/PID */
+ continue;
+
+ sdi = sr_dev_inst_new(devcnt, SR_ST_INITIALIZING,
+ fx2_prof->vendor, fx2_prof->model, fx2_prof->model_version);
+ if (!sdi)
+ return 0;
+ ctx = fx2_dev_new();
+ ctx->profile = fx2_prof;
+ sdi->priv = ctx;
+ dev_insts = g_slist_append(dev_insts, sdi);
+
+ if (check_conf_profile(devlist[i])) {
+ /* Already has the firmware, so fix the new address. */
+ sr_dbg("logic: Found a Saleae Logic with %s firmware.",
+ new_saleae_logic_firmware ? "new" : "old");
+ sdi->status = SR_ST_INACTIVE;
+ ctx->usb = sr_usb_dev_inst_new
+ (libusb_get_bus_number(devlist[i]),
+ libusb_get_device_address(devlist[i]), NULL);
+ } else {
+ if (ezusb_upload_firmware(devlist[i], USB_CONFIGURATION, FIRMWARE) == SR_OK)
+ /* Remember when the firmware on this device was updated */
+ g_get_current_time(&ctx->fw_updated);
+ else
+ sr_err("logic: firmware upload failed for "
+ "device %d", devcnt);
+ ctx->usb = sr_usb_dev_inst_new
+ (libusb_get_bus_number(devlist[i]), 0xff, NULL);
+ }
+ devcnt++;