sr/drivers: add proper probe list to instances of all drivers
This commit is contained in:
parent
b35c829306
commit
87ca93c504
|
@ -443,12 +443,13 @@ static int hw_init(void)
|
||||||
static GSList *hw_scan(GSList *options)
|
static GSList *hw_scan(GSList *options)
|
||||||
{
|
{
|
||||||
struct sr_dev_inst *sdi;
|
struct sr_dev_inst *sdi;
|
||||||
|
struct sr_probe *probe;
|
||||||
struct context *ctx;
|
struct context *ctx;
|
||||||
GSList *devices;
|
GSList *devices;
|
||||||
struct ftdi_device_list *devlist;
|
struct ftdi_device_list *devlist;
|
||||||
char serial_txt[10];
|
char serial_txt[10];
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
int ret;
|
int ret, i;
|
||||||
|
|
||||||
(void)options;
|
(void)options;
|
||||||
devices = NULL;
|
devices = NULL;
|
||||||
|
@ -499,6 +500,14 @@ static GSList *hw_scan(GSList *options)
|
||||||
goto free;
|
goto free;
|
||||||
}
|
}
|
||||||
sdi->driver = adi;
|
sdi->driver = adi;
|
||||||
|
|
||||||
|
for (i = 0; probe_names[i]; i++) {
|
||||||
|
if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
|
||||||
|
probe_names[i])))
|
||||||
|
return NULL;
|
||||||
|
sdi->probes = g_slist_append(sdi->probes, probe);
|
||||||
|
}
|
||||||
|
|
||||||
devices = g_slist_append(devices, sdi);
|
devices = g_slist_append(devices, sdi);
|
||||||
adi->instances = g_slist_append(adi->instances, sdi);
|
adi->instances = g_slist_append(adi->instances, sdi);
|
||||||
sdi->priv = ctx;
|
sdi->priv = ctx;
|
||||||
|
|
|
@ -77,6 +77,7 @@ static int hw_init(void)
|
||||||
static GSList *hw_scan(GSList *options)
|
static GSList *hw_scan(GSList *options)
|
||||||
{
|
{
|
||||||
struct sr_dev_inst *sdi;
|
struct sr_dev_inst *sdi;
|
||||||
|
struct sr_probe *probe;
|
||||||
struct context *ctx;
|
struct context *ctx;
|
||||||
GSList *devices;
|
GSList *devices;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -146,6 +147,13 @@ static GSList *hw_scan(GSList *options)
|
||||||
sdi->driver = cdi;
|
sdi->driver = cdi;
|
||||||
sdi->priv = ctx;
|
sdi->priv = ctx;
|
||||||
|
|
||||||
|
for (i = 0; probe_names[i]; i++) {
|
||||||
|
if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
|
||||||
|
probe_names[i])))
|
||||||
|
return NULL;
|
||||||
|
sdi->probes = g_slist_append(sdi->probes, probe);
|
||||||
|
}
|
||||||
|
|
||||||
devices = g_slist_append(devices, sdi);
|
devices = g_slist_append(devices, sdi);
|
||||||
cdi->instances = g_slist_append(cdi->instances, sdi);
|
cdi->instances = g_slist_append(cdi->instances, sdi);
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,9 @@ static int hw_init(void)
|
||||||
static GSList *hw_scan(GSList *options)
|
static GSList *hw_scan(GSList *options)
|
||||||
{
|
{
|
||||||
struct sr_dev_inst *sdi;
|
struct sr_dev_inst *sdi;
|
||||||
|
struct sr_probe *probe;
|
||||||
GSList *devices;
|
GSList *devices;
|
||||||
|
int i;
|
||||||
|
|
||||||
(void)options;
|
(void)options;
|
||||||
devices = NULL;
|
devices = NULL;
|
||||||
|
@ -164,6 +166,13 @@ static GSList *hw_scan(GSList *options)
|
||||||
}
|
}
|
||||||
sdi->driver = ddi;
|
sdi->driver = ddi;
|
||||||
|
|
||||||
|
for (i = 0; probe_names[i]; i++) {
|
||||||
|
if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
|
||||||
|
probe_names[i])))
|
||||||
|
return NULL;
|
||||||
|
sdi->probes = g_slist_append(sdi->probes, probe);
|
||||||
|
}
|
||||||
|
|
||||||
devices = g_slist_append(devices, sdi);
|
devices = g_slist_append(devices, sdi);
|
||||||
ddi->instances = g_slist_append(ddi->instances, sdi);
|
ddi->instances = g_slist_append(ddi->instances, sdi);
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,9 @@ static struct sr_dev_driver *hdi = &hantek_dso_driver_info;
|
||||||
static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof)
|
static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof)
|
||||||
{
|
{
|
||||||
struct sr_dev_inst *sdi;
|
struct sr_dev_inst *sdi;
|
||||||
|
struct sr_probe *probe;
|
||||||
struct context *ctx;
|
struct context *ctx;
|
||||||
|
int i;
|
||||||
|
|
||||||
sdi = sr_dev_inst_new(index, SR_ST_INITIALIZING,
|
sdi = sr_dev_inst_new(index, SR_ST_INITIALIZING,
|
||||||
prof->vendor, prof->model, NULL);
|
prof->vendor, prof->model, NULL);
|
||||||
|
@ -159,6 +161,16 @@ static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof
|
||||||
return NULL;
|
return NULL;
|
||||||
sdi->driver = hdi;
|
sdi->driver = hdi;
|
||||||
|
|
||||||
|
/* Add only the real probes -- EXT isn't a source of data, only
|
||||||
|
* a trigger source internal to the device.
|
||||||
|
*/
|
||||||
|
for (i = 0; probe_names[i]; i++) {
|
||||||
|
if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
|
||||||
|
probe_names[i])))
|
||||||
|
return NULL;
|
||||||
|
sdi->probes = g_slist_append(sdi->probes, probe);
|
||||||
|
}
|
||||||
|
|
||||||
if (!(ctx = g_try_malloc0(sizeof(struct context)))) {
|
if (!(ctx = g_try_malloc0(sizeof(struct context)))) {
|
||||||
sr_err("hantek-dso: ctx malloc failed");
|
sr_err("hantek-dso: ctx malloc failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -251,6 +251,7 @@ struct sr_dev {
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SR_PROBE_LOGIC,
|
SR_PROBE_LOGIC,
|
||||||
|
SR_PROBE_ANALOG,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sr_probe {
|
struct sr_probe {
|
||||||
|
|
Loading…
Reference in New Issue