Skip to content

Commit 5dc0bb4

Browse files
committed
fx2lafw: handle fx3 changing bus position
1 parent 215fa35 commit 5dc0bb4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/hardware/fx2lafw/protocol.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,19 @@ SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di)
190190
if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0)
191191
continue;
192192

193-
if (strcmp(sdi->connection_id, connection_id))
193+
char const * _sdi_connection_id = sdi->connection_id;
194+
char const * _connection_id = connection_id;
195+
196+
if (devc->profile->dev_caps & DEV_CAPS_FX3) {
197+
_sdi_connection_id = strchr(_sdi_connection_id, '-');
198+
_connection_id = strchr(connection_id, '-');
199+
}
200+
201+
if (strcmp(_sdi_connection_id, _connection_id)) {
194202
/* This is not the one. */
203+
sr_info("Connection mismatch: %s vs. %s", sdi->connection_id, connection_id);
195204
continue;
205+
}
196206
}
197207

198208
if (!(ret = libusb_open(devlist[i], &usb->devhdl))) {

0 commit comments

Comments
 (0)