return sdi;
}
-static int configure_probes(struct dev_context *devc, const GSList *probes)
+static int configure_probes(const struct sr_dev_inst *sdi)
{
+ struct dev_context *devc;
const struct sr_probe *probe;
const GSList *l;
+ devc = sdi->priv;
+
devc->ch1_enabled = devc->ch2_enabled = FALSE;
- for (l = probes; l; l = l->next) {
+ for (l = sdi->probes; l; l = l->next) {
probe = (struct sr_probe *)l->data;
if (probe->index == 0)
devc->ch1_enabled = probe->enabled;
}
/* Properly close and free all devices. */
-static void clear_instances(void)
+static int clear_instances(void)
{
struct sr_dev_inst *sdi;
struct drv_context *drvc;
g_slist_free(drvc->instances);
drvc->instances = NULL;
+ return SR_OK;
}
static int hw_init(void)
return devices;
}
+static GSList *hw_dev_list(void)
+{
+ struct drv_context *drvc;
+
+ drvc = hdi->priv;
+
+ return drvc->instances;
+}
+
static int hw_dev_open(struct sr_dev_inst *sdi)
{
struct dev_context *devc;
case SR_HWCAP_LIMIT_FRAMES:
devc->limit_frames = *(const uint64_t *)value;
break;
- case SR_HWCAP_PROBECONFIG:
- ret = configure_probes(devc, (const GSList *)value);
- break;
case SR_HWCAP_TRIGGER_SLOPE:
tmp_u64 = *(const int *)value;
if (tmp_u64 != SLOPE_NEGATIVE && tmp_u64 != SLOPE_POSITIVE)
devc = sdi->priv;
devc->cb_data = cb_data;
+ if (configure_probes(sdi) != SR_OK) {
+ sr_err("hantek-dso: failed to configured probes");
+ return SR_ERR;
+ }
+
if (dso_init(devc) != SR_OK)
return SR_ERR;
.init = hw_init,
.cleanup = hw_cleanup,
.scan = hw_scan,
+ .dev_list = hw_dev_list,
+ .dev_clear = clear_instances,
.dev_open = hw_dev_open,
.dev_close = hw_dev_close,
.info_get = hw_info_get,