Change in simtrace2[master]: host USB: use central SIMtrace USB ID definition header

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Jul 4 15:44:16 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9871 )

Change subject: host USB: use central SIMtrace USB ID definition header
......................................................................

host USB: use central SIMtrace USB ID definition header

Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9
---
M host/simtrace2_usb.c
A host/simtrace_usb.h
2 files changed, 5 insertions(+), 12 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/host/simtrace2_usb.c b/host/simtrace2_usb.c
index 6cbb8b7..2016670 100644
--- a/host/simtrace2_usb.c
+++ b/host/simtrace2_usb.c
@@ -6,15 +6,7 @@
 #include <osmocom/core/utils.h>
 
 #include "libusb_util.h"
-
-#define USB_VENDOR_OPENMOKO		0x1d50
-#define USB_PRODUCT_OWHW_SAM3_DFU	0x4000
-#define USB_PRODUCT_OWHW_SAM3		0x4001
-#define USB_PRODUCT_QMOD_HUB		0x4002
-#define USB_PRODUCT_QMOD_SAM3_DFU	0x4003
-#define USB_PRODUCT_QMOD_SAM3		0x4004
-#define USB_PRODUCT_SIMTRACE2_DFU	0x60e2
-#define USB_PRODUCT_SIMTRACE2		0x60e3
+#include "simtrace_usb.h"
 
 static const struct dev_id compatible_dev_ids[] = {
 	{ USB_VENDOR_OPENMOKO, USB_PRODUCT_OWHW_SAM3 },
@@ -23,15 +15,15 @@
 	{ 0, 0 }
 };
 
-//libusb_get_string_descriptor_ascii(hdl, idx, *data, len)
-
 static int find_devices(void)
 {
 	struct usb_interface_match ifm[16];
 	int rc, i, num_interfaces;
 
+	/* scan for USB devices matching SIMtrace USB ID with proprietary class */ 
 	rc = usb_match_interfaces(NULL, compatible_dev_ids,
-				  255, 2, -1, ifm, ARRAY_SIZE(ifm));
+				 USB_CLASS_PROPRIETARY, -1, -1, ifm, ARRAY_SIZE(ifm));
+	printf("USB matches: %d\n", rc);
 	if (rc < 0)
 		return rc;
 	num_interfaces = rc;
diff --git a/host/simtrace_usb.h b/host/simtrace_usb.h
new file mode 120000
index 0000000..f1e0982
--- /dev/null
+++ b/host/simtrace_usb.h
@@ -0,0 +1 @@
+../firmware/libcommon/include/simtrace_usb.h
\ No newline at end of file

-- 
To view, visit https://gerrit.osmocom.org/9871
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9
Gerrit-Change-Number: 9871
Gerrit-PatchSet: 7
Gerrit-Owner: Kévin Redon <kredon at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180704/235b0f7f/attachment.htm>


More information about the gerrit-log mailing list