mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-20 07:18:33 +03:00
host USB: use central SIMtrace USB ID definition header
Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9
This commit is contained in:
@@ -6,15 +6,7 @@
|
|||||||
#include <osmocom/core/utils.h>
|
#include <osmocom/core/utils.h>
|
||||||
|
|
||||||
#include "libusb_util.h"
|
#include "libusb_util.h"
|
||||||
|
#include "simtrace_usb.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
|
|
||||||
|
|
||||||
static const struct dev_id compatible_dev_ids[] = {
|
static const struct dev_id compatible_dev_ids[] = {
|
||||||
{ USB_VENDOR_OPENMOKO, USB_PRODUCT_OWHW_SAM3 },
|
{ USB_VENDOR_OPENMOKO, USB_PRODUCT_OWHW_SAM3 },
|
||||||
@@ -23,15 +15,15 @@ static const struct dev_id compatible_dev_ids[] = {
|
|||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
//libusb_get_string_descriptor_ascii(hdl, idx, *data, len)
|
|
||||||
|
|
||||||
static int find_devices(void)
|
static int find_devices(void)
|
||||||
{
|
{
|
||||||
struct usb_interface_match ifm[16];
|
struct usb_interface_match ifm[16];
|
||||||
int rc, i, num_interfaces;
|
int rc, i, num_interfaces;
|
||||||
|
|
||||||
|
/* scan for USB devices matching SIMtrace USB ID with proprietary class */
|
||||||
rc = usb_match_interfaces(NULL, compatible_dev_ids,
|
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)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
num_interfaces = rc;
|
num_interfaces = rc;
|
||||||
|
|||||||
1
host/simtrace_usb.h
Symbolic link
1
host/simtrace_usb.h
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../firmware/libcommon/include/simtrace_usb.h
|
||||||
Reference in New Issue
Block a user