SR_PRIV struct sr_dev_driver fx2lafw_driver_info;
static struct sr_dev_driver *fdi = &fx2lafw_driver_info;
-static int hw_dev_config_set(int dev_index, int hwcap, const void *value);
+static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
+ const void *value);
static int hw_dev_acquisition_stop(int dev_index, void *cb_data);
/**
prof->vendor, prof->model, prof->model_version);
if (!sdi)
return 0;
+ sdi->driver = fdi;
/* Fill in probelist according to this device's profile. */
num_logic_probes = prof->dev_caps & DEV_CAPS_16BIT ? 16 : 8;
- for (j = 0; i < num_logic_probes; j++) {
+ for (j = 0; j < num_logic_probes; j++) {
if (!(probe = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
probe_names[j])))
return 0;
if (ctx->cur_samplerate == 0) {
/* Samplerate hasn't been set; default to the slowest one. */
- if (hw_dev_config_set(dev_index, SR_HWCAP_SAMPLERATE,
+ if (hw_dev_config_set(sdi, SR_HWCAP_SAMPLERATE,
&supported_samplerates[0]) == SR_ERR)
return SR_ERR;
}
return ret;
}
-static int hw_info_get(int dev_info_id, const void **data,
+static int hw_info_get(int info_id, const void **data,
const struct sr_dev_inst *sdi)
{
struct context *ctx;
- switch (dev_info_id) {
+ switch (info_id) {
case SR_DI_INST:
- return sdi;
+ *data = sdi;
+ break;
+ case SR_DI_HWCAPS:
+ *data = hwcaps;
+ break;
case SR_DI_NUM_PROBES:
if (sdi) {
ctx = sdi->priv;
return sdi->status;
}
-static const int *hw_hwcap_get_all(void)
-{
- return hwcaps;
-}
-
-static int hw_dev_config_set(int dev_index, int hwcap, const void *value)
+static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
+ const void *value)
{
- struct sr_dev_inst *sdi;
struct context *ctx;
int ret;
- if (!(sdi = sr_dev_inst_get(fdi->instances, dev_index)))
- return SR_ERR;
ctx = sdi->priv;
if (hwcap == SR_HWCAP_SAMPLERATE) {
.dev_close = hw_dev_close,
.info_get = hw_info_get,
.dev_status_get = hw_dev_status_get,
- .hwcap_get_all = hw_hwcap_get_all,
.dev_config_set = hw_dev_config_set,
.dev_acquisition_start = hw_dev_acquisition_start,
.dev_acquisition_stop = hw_dev_acquisition_stop,