Consistently use 'cg' for channel group variables.

This matches how we consistently use sdi, devc, and so on all over
the code-base.

This fixes parts of bug #259.
This commit is contained in:
Uwe Hermann 2014-03-20 21:58:01 +01:00
parent a68bf88e3a
commit 53b4680fce
42 changed files with 253 additions and 257 deletions

View File

@ -170,11 +170,11 @@ static int cleanup(void)
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -208,10 +208,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -129,11 +129,11 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
@ -148,11 +148,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -174,14 +174,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
GVariant *gvar; GVariant *gvar;
GVariantBuilder gvb; GVariantBuilder gvb;
int i; int i;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:

View File

@ -138,11 +138,11 @@ static int cleanup(void)
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc = sdi->priv; struct dev_context *devc = sdi->priv;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_LIMIT_SAMPLES: case SR_CONF_LIMIT_SAMPLES:
@ -162,13 +162,13 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
const char *tmp_str; const char *tmp_str;
unsigned int i; unsigned int i;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -206,10 +206,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -745,11 +745,11 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
@ -767,12 +767,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
int ret; int ret;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -801,13 +801,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *gvar; GVariant *gvar;
GVariantBuilder gvb; GVariantBuilder gvb;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:

View File

@ -206,7 +206,7 @@ static int cleanup(void)
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
struct sr_probe *probe; struct sr_probe *probe;
@ -218,7 +218,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
devc = sdi->priv; devc = sdi->priv;
ret = SR_OK; ret = SR_OK;
if (!channel_group) { if (!cg) {
/* No channel group: global options. */ /* No channel group: global options. */
switch (key) { switch (key) {
case SR_CONF_OUTPUT_CHANNEL: case SR_CONF_OUTPUT_CHANNEL:
@ -232,7 +232,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
} }
} else { } else {
/* We only ever have one channel per channel group in this driver. */ /* We only ever have one channel per channel group in this driver. */
probe = channel_group->channels->data; probe = cg->channels->data;
channel = probe->index; channel = probe->index;
switch (key) { switch (key) {
@ -275,7 +275,7 @@ static int find_str(const char *str, const char **strings, int array_size)
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
struct sr_probe *probe; struct sr_probe *probe;
@ -289,7 +289,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
ret = SR_OK; ret = SR_OK;
devc = sdi->priv; devc = sdi->priv;
if (!channel_group) { if (!cg) {
/* No channel group: global options. */ /* No channel group: global options. */
switch (key) { switch (key) {
case SR_CONF_OUTPUT_CHANNEL: case SR_CONF_OUTPUT_CHANNEL:
@ -323,7 +323,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} else { } else {
/* Channel group specified: per-channel options. */ /* Channel group specified: per-channel options. */
/* We only ever have one channel per channel group in this driver. */ /* We only ever have one channel per channel group in this driver. */
probe = channel_group->channels->data; probe = cg->channels->data;
channel = probe->index; channel = probe->index;
switch (key) { switch (key) {
@ -359,7 +359,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
struct sr_probe *probe; struct sr_probe *probe;
@ -379,7 +379,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
devc = sdi->priv; devc = sdi->priv;
ret = SR_OK; ret = SR_OK;
if (!channel_group) { if (!cg) {
/* No channel group: global options. */ /* No channel group: global options. */
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
@ -403,7 +403,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
if (!sdi) if (!sdi)
return SR_ERR_ARG; return SR_ERR_ARG;
/* We only ever have one channel per channel group in this driver. */ /* We only ever have one channel per channel group in this driver. */
probe = channel_group->channels->data; probe = cg->channels->data;
channel = probe->index; channel = probe->index;
switch (key) { switch (key) {

View File

@ -183,11 +183,11 @@ static int cleanup(void)
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc = sdi->priv; struct dev_context *devc = sdi->priv;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_LIMIT_SAMPLES: case SR_CONF_LIMIT_SAMPLES:
@ -204,11 +204,11 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -235,10 +235,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -150,12 +150,12 @@ static int cleanup(void)
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
int ret; int ret;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -181,10 +181,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -166,14 +166,14 @@ static int cleanup(void)
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
GVariant *range[2]; GVariant *range[2];
uint64_t low, high; uint64_t low, high;
int tmp, ret; int tmp, ret;
(void)channel_group; (void)cg;
if (!sdi) if (!sdi)
return SR_ERR_ARG; return SR_ERR_ARG;
@ -238,7 +238,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
uint64_t tmp_u64, low, high; uint64_t tmp_u64, low, high;
@ -246,7 +246,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
int tmp, ret; int tmp, ret;
const char *tmp_str; const char *tmp_str;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -328,7 +328,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *tuple, *range[2]; GVariant *tuple, *range[2];
GVariantBuilder gvb; GVariantBuilder gvb;
@ -336,7 +336,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
int ret; int ret;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
ret = SR_OK; ret = SR_OK;
switch (key) { switch (key) {

View File

@ -161,11 +161,11 @@ static int cleanup(int idx)
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -191,10 +191,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -263,11 +263,11 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
@ -287,11 +287,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -333,13 +333,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *gvar, *grange[2]; GVariant *gvar, *grange[2];
GVariantBuilder gvb; GVariantBuilder gvb;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:

View File

@ -130,11 +130,11 @@ static int cleanup(void)
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -168,10 +168,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -122,12 +122,12 @@ static int cleanup(void)
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
int ret; int ret;
double dblval; double dblval;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -165,12 +165,12 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
int ret; int ret;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
ret = SR_OK; ret = SR_OK;
switch (key) { switch (key) {

View File

@ -171,7 +171,7 @@ static int init(struct sr_context *sr_ctx)
return std_init(sr_ctx, di, LOG_PREFIX); return std_init(sr_ctx, di, LOG_PREFIX);
} }
static void generate_analog_pattern(const struct sr_channel_group *channel_group, uint64_t sample_rate) static void generate_analog_pattern(const struct sr_channel_group *cg, uint64_t sample_rate)
{ {
struct analog_gen *ag; struct analog_gen *ag;
double t, frequency; double t, frequency;
@ -179,12 +179,11 @@ static void generate_analog_pattern(const struct sr_channel_group *channel_group
unsigned int num_samples, i; unsigned int num_samples, i;
int last_end; int last_end;
ag = channel_group->priv; ag = cg->priv;
num_samples = ANALOG_BUFSIZE / sizeof(float); num_samples = ANALOG_BUFSIZE / sizeof(float);
sr_dbg("Generating %s pattern for channel group %s", sr_dbg("Generating %s pattern for channel group %s",
analog_pattern_str[ag->pattern], analog_pattern_str[ag->pattern], cg->name);
channel_group->name);
switch (ag->pattern) { switch (ag->pattern) {
case PATTERN_SQUARE: case PATTERN_SQUARE:
@ -383,7 +382,7 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
struct sr_probe *probe; struct sr_probe *probe;
@ -405,14 +404,14 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
*data = g_variant_new_uint64(devc->limit_msec); *data = g_variant_new_uint64(devc->limit_msec);
break; break;
case SR_CONF_PATTERN_MODE: case SR_CONF_PATTERN_MODE:
if (!channel_group) if (!cg)
return SR_ERR_CHANNEL_GROUP; return SR_ERR_CHANNEL_GROUP;
probe = channel_group->channels->data; probe = cg->channels->data;
if (probe->type == SR_PROBE_LOGIC) { if (probe->type == SR_PROBE_LOGIC) {
pattern = devc->logic_pattern; pattern = devc->logic_pattern;
*data = g_variant_new_string(logic_pattern_str[pattern]); *data = g_variant_new_string(logic_pattern_str[pattern]);
} else if (probe->type == SR_PROBE_ANALOG) { } else if (probe->type == SR_PROBE_ANALOG) {
ag = channel_group->priv; ag = cg->priv;
pattern = ag->pattern; pattern = ag->pattern;
*data = g_variant_new_string(analog_pattern_str[pattern]); *data = g_variant_new_string(analog_pattern_str[pattern]);
} else } else
@ -432,7 +431,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
struct analog_gen *ag; struct analog_gen *ag;
@ -463,10 +462,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
sr_dbg("Setting time limit to %" PRIu64"ms", devc->limit_msec); sr_dbg("Setting time limit to %" PRIu64"ms", devc->limit_msec);
break; break;
case SR_CONF_PATTERN_MODE: case SR_CONF_PATTERN_MODE:
if (!channel_group) if (!cg)
return SR_ERR_CHANNEL_GROUP; return SR_ERR_CHANNEL_GROUP;
stropt = g_variant_get_string(data, NULL); stropt = g_variant_get_string(data, NULL);
probe = channel_group->channels->data; probe = cg->channels->data;
pattern = -1; pattern = -1;
if (probe->type == SR_PROBE_LOGIC) { if (probe->type == SR_PROBE_LOGIC) {
for (i = 0; i < ARRAY_SIZE(logic_pattern_str); i++) { for (i = 0; i < ARRAY_SIZE(logic_pattern_str); i++) {
@ -496,9 +495,8 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
if (pattern == -1) if (pattern == -1)
return SR_ERR_ARG; return SR_ERR_ARG;
sr_dbg("Setting analog pattern for channel group %s to %s", sr_dbg("Setting analog pattern for channel group %s to %s",
channel_group->name, cg->name, analog_pattern_str[pattern]);
analog_pattern_str[pattern]); ag = cg->priv;
ag = channel_group->priv;
ag->pattern = pattern; ag->pattern = pattern;
} else } else
return SR_ERR_BUG; return SR_ERR_BUG;
@ -511,7 +509,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct sr_probe *probe; struct sr_probe *probe;
GVariant *gvar; GVariant *gvar;
@ -528,7 +526,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
if (!sdi) if (!sdi)
return SR_ERR_ARG; return SR_ERR_ARG;
if (!channel_group) { if (!cg) {
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
@ -545,7 +543,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
return SR_ERR_NA; return SR_ERR_NA;
} }
} else { } else {
probe = channel_group->channels->data; probe = cg->channels->data;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,

View File

@ -204,11 +204,11 @@ static int cleanup(void)
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -242,10 +242,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -347,13 +347,13 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
struct sr_usb_dev_inst *usb; struct sr_usb_dev_inst *usb;
char str[128]; char str[128];
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_CONN: case SR_CONF_CONN:
@ -381,12 +381,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
int ret; int ret;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR; return SR_ERR;
@ -407,13 +407,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *gvar; GVariant *gvar;
GVariantBuilder gvb; GVariantBuilder gvb;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -423,18 +423,18 @@ static int cleanup_2x_bd232(void)
/** Get value of configuration item */ /** Get value of configuration item */
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
int ret; int ret;
struct dev_context *devc; struct dev_context *devc;
(void)sdi; (void)sdi;
(void)data; (void)data;
(void)channel_group; (void)cg;
ret = SR_OK; ret = SR_OK;
(void)channel_group; (void)cg;
if (!sdi || !(devc = sdi->priv)) if (!sdi || !(devc = sdi->priv))
return SR_ERR_ARG; return SR_ERR_ARG;
@ -460,10 +460,10 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
/** Implementation of config_list, auxiliary function for common parts, */ /** Implementation of config_list, auxiliary function for common parts, */
static int config_list_common(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list_common(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:
@ -479,10 +479,9 @@ static int config_list_common(int key, GVariant **data, const struct sr_dev_inst
/** Implementation of config_list for Metrahit 1x/2x send mode */ /** Implementation of config_list for Metrahit 1x/2x send mode */
static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
@ -490,7 +489,7 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd
hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(int32_t)); hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(int32_t));
break; break;
default: default:
return config_list_common(key, data, sdi, channel_group); return config_list_common(key, data, sdi, cg);
} }
return SR_OK; return SR_OK;
@ -498,10 +497,9 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd
/** Implementation of config_list for Metrahit 2x bidirectional mode */ /** Implementation of config_list for Metrahit 2x bidirectional mode */
static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
@ -509,7 +507,7 @@ static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sd
hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(int32_t)); hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(int32_t));
break; break;
default: default:
return config_list_common(key, data, sdi, channel_group); return config_list_common(key, data, sdi, cg);
} }
return SR_OK; return SR_OK;

View File

@ -1492,13 +1492,13 @@ SR_PRIV const char *gmc_model_str(enum model mcode)
/** @copydoc sr_dev_driver.config_set /** @copydoc sr_dev_driver.config_set
*/ */
SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
uint8_t params[9]; uint8_t params[9];
uint8_t msg[42]; uint8_t msg[42];
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;

View File

@ -120,7 +120,7 @@ struct dev_context {
/* Forward declarations */ /* Forward declarations */
SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group); const struct sr_channel_group *cg);
SR_PRIV void create_cmd_14(guchar addr, guchar func, guchar* params, guchar* buf); SR_PRIV void create_cmd_14(guchar addr, guchar func, guchar* params, guchar* buf);
SR_PRIV void dump_msg14(guchar* buf, gboolean raw); SR_PRIV void dump_msg14(guchar* buf, gboolean raw);
SR_PRIV int gmc_decode_model_bd(uint8_t mcode); SR_PRIV int gmc_decode_model_bd(uint8_t mcode);

View File

@ -184,22 +184,22 @@ static int cleanup(void)
} }
static int check_channel_group(struct dev_context *devc, static int check_channel_group(struct dev_context *devc,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
unsigned int i; unsigned int i;
struct scope_config *model; struct scope_config *model;
model = devc->model_config; model = devc->model_config;
if (!channel_group) if (!cg)
return PG_NONE; return PG_NONE;
for (i = 0; i < model->analog_channels; ++i) for (i = 0; i < model->analog_channels; ++i)
if (channel_group == &devc->analog_groups[i]) if (cg == &devc->analog_groups[i])
return PG_ANALOG; return PG_ANALOG;
for (i = 0; i < model->digital_pods; ++i) for (i = 0; i < model->digital_pods; ++i)
if (channel_group == &devc->digital_groups[i]) if (cg == &devc->digital_groups[i])
return PG_DIGITAL; return PG_DIGITAL;
sr_err("Invalid channel group specified."); sr_err("Invalid channel group specified.");
@ -208,7 +208,7 @@ static int check_channel_group(struct dev_context *devc,
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
int ret, pg_type; int ret, pg_type;
unsigned int i; unsigned int i;
@ -219,7 +219,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
if (!sdi || !(devc = sdi->priv)) if (!sdi || !(devc = sdi->priv))
return SR_ERR_ARG; return SR_ERR_ARG;
if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID) if ((pg_type = check_channel_group(devc, cg)) == PG_INVALID)
return SR_ERR; return SR_ERR;
ret = SR_ERR_NA; ret = SR_ERR_NA;
@ -242,7 +242,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
return SR_ERR_CHANNEL_GROUP; return SR_ERR_CHANNEL_GROUP;
} else if (pg_type == PG_ANALOG) { } else if (pg_type == PG_ANALOG) {
for (i = 0; i < model->analog_channels; ++i) { for (i = 0; i < model->analog_channels; ++i) {
if (channel_group != &devc->analog_groups[i]) if (cg != &devc->analog_groups[i])
continue; continue;
*data = g_variant_new_int32(model->num_ydivs); *data = g_variant_new_int32(model->num_ydivs);
ret = SR_OK; ret = SR_OK;
@ -290,7 +290,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
return SR_ERR_CHANNEL_GROUP; return SR_ERR_CHANNEL_GROUP;
} else if (pg_type == PG_ANALOG) { } else if (pg_type == PG_ANALOG) {
for (i = 0; i < model->analog_channels; ++i) { for (i = 0; i < model->analog_channels; ++i) {
if (channel_group != &devc->analog_groups[i]) if (cg != &devc->analog_groups[i])
continue; continue;
*data = g_variant_new_string((*model->coupling_options)[state->analog_channels[i].coupling]); *data = g_variant_new_string((*model->coupling_options)[state->analog_channels[i].coupling]);
ret = SR_OK; ret = SR_OK;
@ -332,7 +332,7 @@ static GVariant *build_tuples(const uint64_t (*array)[][2], unsigned int n)
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
int ret, pg_type; int ret, pg_type;
unsigned int i, j; unsigned int i, j;
@ -348,7 +348,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
if (!sdi || !(devc = sdi->priv)) if (!sdi || !(devc = sdi->priv))
return SR_ERR_ARG; return SR_ERR_ARG;
if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID) if ((pg_type = check_channel_group(devc, cg)) == PG_INVALID)
return SR_ERR; return SR_ERR;
model = devc->model_config; model = devc->model_config;
@ -389,7 +389,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
q != (*model->vdivs)[i][1]) q != (*model->vdivs)[i][1])
continue; continue;
for (j = 1; j <= model->analog_channels; ++j) { for (j = 1; j <= model->analog_channels; ++j) {
if (channel_group != &devc->analog_groups[j - 1]) if (cg != &devc->analog_groups[j - 1])
continue; continue;
state->analog_channels[j - 1].vdiv = i; state->analog_channels[j - 1].vdiv = i;
g_ascii_formatd(float_str, sizeof(float_str), "%E", (float) p / q); g_ascii_formatd(float_str, sizeof(float_str), "%E", (float) p / q);
@ -471,7 +471,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
if (strcmp(tmp, (*model->coupling_options)[i]) != 0) if (strcmp(tmp, (*model->coupling_options)[i]) != 0)
continue; continue;
for (j = 1; j <= model->analog_channels; ++j) { for (j = 1; j <= model->analog_channels; ++j) {
if (channel_group != &devc->analog_groups[j - 1]) if (cg != &devc->analog_groups[j - 1])
continue; continue;
state->analog_channels[j-1].coupling = i; state->analog_channels[j-1].coupling = i;
@ -504,7 +504,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
int pg_type; int pg_type;
struct dev_context *devc; struct dev_context *devc;
@ -513,7 +513,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
if (!sdi || !(devc = sdi->priv)) if (!sdi || !(devc = sdi->priv))
return SR_ERR_ARG; return SR_ERR_ARG;
if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID) if ((pg_type = check_channel_group(devc, cg)) == PG_INVALID)
return SR_ERR; return SR_ERR;
model = devc->model_config; model = devc->model_config;

View File

@ -423,12 +423,12 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct sr_usb_dev_inst *usb; struct sr_usb_dev_inst *usb;
char str[128]; char str[128];
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_CONN: case SR_CONF_CONN:
@ -456,7 +456,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
double tmp_double; double tmp_double;
@ -466,7 +466,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const char *tmp_str; const char *tmp_str;
char **targets; char **targets;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -587,14 +587,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
GVariant *tuple, *rational[2]; GVariant *tuple, *rational[2];
GVariantBuilder gvb; GVariantBuilder gvb;
unsigned int i; unsigned int i;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -308,12 +308,12 @@ static int cleanup(void)
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
int ret; int ret;
(void)channel_group; (void)cg;
ret = SR_OK; ret = SR_OK;
devc = sdi->priv; devc = sdi->priv;
@ -333,12 +333,12 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
uint64_t samplerate, limit_samples, capture_ratio; uint64_t samplerate, limit_samples, capture_ratio;
int ret; int ret;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -366,14 +366,14 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *gvar, *grange[2]; GVariant *gvar, *grange[2];
GVariantBuilder gvb; GVariantBuilder gvb;
int ret; int ret;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
ret = SR_OK; ret = SR_OK;

View File

@ -280,10 +280,10 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
@ -298,11 +298,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -335,13 +335,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *gvar; GVariant *gvar;
GVariantBuilder gvb; GVariantBuilder gvb;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:

View File

@ -249,13 +249,13 @@ static int cleanup(void)
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
GVariant *rational[2]; GVariant *rational[2];
const uint64_t *si; const uint64_t *si;
(void)channel_group; (void)cg;
devc = sdi->priv; devc = sdi->priv;
switch (key) { switch (key) {
@ -298,7 +298,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
uint64_t p, q; uint64_t p, q;
@ -306,7 +306,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
int tmp, ret; int tmp, ret;
const char *tmp_str; const char *tmp_str;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -378,14 +378,14 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *tuple, *rational[2]; GVariant *tuple, *rational[2];
GVariantBuilder gvb; GVariantBuilder gvb;
unsigned int i; unsigned int i;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:

View File

@ -159,14 +159,14 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
struct sr_usb_dev_inst *usb; struct sr_usb_dev_inst *usb;
int ret; int ret;
char str[128]; char str[128];
(void)channel_group; (void)cg;
devc = sdi->priv; devc = sdi->priv;
switch (id) { switch (id) {
@ -195,12 +195,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
int ret; int ret;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -235,10 +235,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -276,11 +276,11 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
@ -298,7 +298,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
int ret; int ret;
struct dev_context *devc; struct dev_context *devc;
@ -307,7 +307,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
int trigger_pos; int trigger_pos;
double pos; double pos;
(void)channel_group; (void)cg;
devc = sdi->priv; devc = sdi->priv;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
@ -369,12 +369,12 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *gvar; GVariant *gvar;
GVariantBuilder gvb; GVariantBuilder gvb;
(void)channel_group; (void)cg;
(void)sdi; (void)sdi;
switch (key) { switch (key) {

View File

@ -163,11 +163,11 @@ static int cleanup(int idx)
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -193,10 +193,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -185,11 +185,11 @@ static int cleanup(void)
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -223,10 +223,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -213,11 +213,11 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (!sdi) if (!sdi)
return SR_ERR_ARG; return SR_ERR_ARG;
@ -252,7 +252,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
uint16_t flag; uint16_t flag;
@ -260,7 +260,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
int ret; int ret;
const char *stropt; const char *stropt;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -349,14 +349,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
GVariant *gvar, *grange[2]; GVariant *gvar, *grange[2];
GVariantBuilder gvb; GVariantBuilder gvb;
int num_channels, i; int num_channels, i;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -477,7 +477,7 @@ static int digital_frame_size(const struct sr_dev_inst *sdi)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
struct sr_probe *probe; struct sr_probe *probe;
@ -492,13 +492,13 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
return SR_ERR_ARG; return SR_ERR_ARG;
/* If a channel group is specified, it must be a valid one. */ /* If a channel group is specified, it must be a valid one. */
if (channel_group && !g_slist_find(sdi->channel_groups, channel_group)) { if (cg && !g_slist_find(sdi->channel_groups, cg)) {
sr_err("Invalid channel group specified."); sr_err("Invalid channel group specified.");
return SR_ERR; return SR_ERR;
} }
if (channel_group) { if (cg) {
probe = g_slist_nth_data(channel_group->channels, 0); probe = g_slist_nth_data(cg->channels, 0);
if (!probe) if (!probe)
return SR_ERR; return SR_ERR;
if (probe->type == SR_PROBE_ANALOG) { if (probe->type == SR_PROBE_ANALOG) {
@ -588,7 +588,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
uint64_t p, q; uint64_t p, q;
@ -605,7 +605,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
/* If a channel group is specified, it must be a valid one. */ /* If a channel group is specified, it must be a valid one. */
if (channel_group && !g_slist_find(sdi->channel_groups, channel_group)) { if (cg && !g_slist_find(sdi->channel_groups, cg)) {
sr_err("Invalid channel group specified."); sr_err("Invalid channel group specified.");
return SR_ERR; return SR_ERR;
} }
@ -676,13 +676,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
ret = SR_ERR_ARG; ret = SR_ERR_ARG;
break; break;
case SR_CONF_VDIV: case SR_CONF_VDIV:
if (!channel_group) { if (!cg) {
sr_err("No channel group specified."); sr_err("No channel group specified.");
return SR_ERR_CHANNEL_GROUP; return SR_ERR_CHANNEL_GROUP;
} }
g_variant_get(data, "(tt)", &p, &q); g_variant_get(data, "(tt)", &p, &q);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (channel_group == &devc->analog_groups[i]) { if (cg == &devc->analog_groups[i]) {
for (j = 0; j < ARRAY_SIZE(vdivs); j++) { for (j = 0; j < ARRAY_SIZE(vdivs); j++) {
if (vdivs[j][0] != p || vdivs[j][1] != q) if (vdivs[j][0] != p || vdivs[j][1] != q)
continue; continue;
@ -697,13 +697,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
return SR_ERR_NA; return SR_ERR_NA;
case SR_CONF_COUPLING: case SR_CONF_COUPLING:
if (!channel_group) { if (!cg) {
sr_err("No channel group specified."); sr_err("No channel group specified.");
return SR_ERR_CHANNEL_GROUP; return SR_ERR_CHANNEL_GROUP;
} }
tmp_str = g_variant_get_string(data, NULL); tmp_str = g_variant_get_string(data, NULL);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (channel_group == &devc->analog_groups[i]) { if (cg == &devc->analog_groups[i]) {
for (j = 0; j < ARRAY_SIZE(coupling); j++) { for (j = 0; j < ARRAY_SIZE(coupling); j++) {
if (!strcmp(tmp_str, coupling[j])) { if (!strcmp(tmp_str, coupling[j])) {
g_free(devc->coupling[i]); g_free(devc->coupling[i]);
@ -738,7 +738,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *tuple, *rational[2]; GVariant *tuple, *rational[2];
GVariantBuilder gvb; GVariantBuilder gvb;
@ -752,7 +752,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
return SR_OK; return SR_OK;
} else if (key == SR_CONF_DEVICE_OPTIONS && channel_group == NULL) { } else if (key == SR_CONF_DEVICE_OPTIONS && cg == NULL) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
return SR_OK; return SR_OK;
@ -763,9 +763,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
return SR_ERR_ARG; return SR_ERR_ARG;
/* If a channel group is specified, it must be a valid one. */ /* If a channel group is specified, it must be a valid one. */
if (channel_group) { if (cg) {
if (channel_group != &devc->analog_groups[0] if (cg != &devc->analog_groups[0]
&& channel_group != &devc->analog_groups[1]) { && cg != &devc->analog_groups[1]) {
sr_err("Invalid channel group specified."); sr_err("Invalid channel group specified.");
return SR_ERR; return SR_ERR;
} }
@ -773,17 +773,17 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
if (!channel_group) { if (!cg) {
sr_err("No channel group specified."); sr_err("No channel group specified.");
return SR_ERR_CHANNEL_GROUP; return SR_ERR_CHANNEL_GROUP;
} }
if (channel_group == &devc->digital_group) { if (cg == &devc->digital_group) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
NULL, 0, sizeof(int32_t)); NULL, 0, sizeof(int32_t));
return SR_OK; return SR_OK;
} else { } else {
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (channel_group == &devc->analog_groups[i]) { if (cg == &devc->analog_groups[i]) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(int32_t)); analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(int32_t));
return SR_OK; return SR_OK;
@ -793,7 +793,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
} }
break; break;
case SR_CONF_COUPLING: case SR_CONF_COUPLING:
if (!channel_group) { if (!cg) {
sr_err("No channel group specified."); sr_err("No channel group specified.");
return SR_ERR_CHANNEL_GROUP; return SR_ERR_CHANNEL_GROUP;
} }
@ -803,7 +803,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
if (!devc) if (!devc)
/* Can't know this until we have the exact model. */ /* Can't know this until we have the exact model. */
return SR_ERR_ARG; return SR_ERR_ARG;
if (!channel_group) { if (!cg) {
sr_err("No channel group specified."); sr_err("No channel group specified.");
return SR_ERR_CHANNEL_GROUP; return SR_ERR_CHANNEL_GROUP;
} }

View File

@ -428,7 +428,7 @@ static int cleanup(void)
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
struct sr_usb_dev_inst *usb; struct sr_usb_dev_inst *usb;
@ -437,7 +437,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
int ret; int ret;
unsigned int i; unsigned int i;
(void)channel_group; (void)cg;
ret = SR_OK; ret = SR_OK;
switch (key) { switch (key) {
@ -482,14 +482,14 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
gdouble low, high; gdouble low, high;
int ret; int ret;
unsigned int i; unsigned int i;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -525,7 +525,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *gvar, *range[2]; GVariant *gvar, *range[2];
GVariantBuilder gvb; GVariantBuilder gvb;
@ -533,7 +533,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
unsigned int i; unsigned int i;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
ret = SR_OK; ret = SR_OK;
switch (key) { switch (key) {

View File

@ -460,11 +460,11 @@ static int cleanup(int dmm)
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -493,10 +493,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -265,12 +265,12 @@ static int cleanup(void)
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
size_t idx; size_t idx;
(void)channel_group; (void)cg;
if (!sdi) if (!sdi)
return SR_ERR_ARG; return SR_ERR_ARG;
@ -337,13 +337,13 @@ static int lookup_index(GVariant *value, const char *const *table, int len)
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
uint64_t value; uint64_t value;
struct dev_context *devc; struct dev_context *devc;
int idx; int idx;
(void)channel_group; (void)cg;
devc = sdi->priv; devc = sdi->priv;
if (!devc) if (!devc)
@ -477,13 +477,13 @@ static int config_commit(const struct sr_dev_inst *sdi)
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
GVariant *gvar; GVariant *gvar;
GVariantBuilder gvb; GVariantBuilder gvb;
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -178,11 +178,11 @@ static int cleanup(void)
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -209,10 +209,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -129,11 +129,11 @@ static int cleanup(void)
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -154,10 +154,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -272,11 +272,11 @@ static int cleanup(int dmm)
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
devc = sdi->priv; devc = sdi->priv;
@ -307,10 +307,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -200,11 +200,11 @@ static int cleanup(void)
} }
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
devc = sdi->priv; devc = sdi->priv;
switch (key) { switch (key) {
@ -225,13 +225,13 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
int ret; int ret;
const char *tmp_str; const char *tmp_str;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -266,11 +266,11 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:

View File

@ -202,12 +202,12 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct sr_usb_dev_inst *usb; struct sr_usb_dev_inst *usb;
char str[128]; char str[128];
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_CONN: case SR_CONF_CONN:
@ -225,13 +225,13 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
gint64 now; gint64 now;
int ret; int ret;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -264,10 +264,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_SCAN_OPTIONS: case SR_CONF_SCAN_OPTIONS:

View File

@ -467,11 +467,11 @@ static int cleanup(void)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
@ -508,12 +508,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
gdouble low, high; gdouble low, high;
(void)channel_group; (void)cg;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED; return SR_ERR_DEV_CLOSED;
@ -541,7 +541,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct dev_context *devc; struct dev_context *devc;
GVariant *gvar, *grange[2]; GVariant *gvar, *grange[2];
@ -549,7 +549,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
double v; double v;
GVariant *range[2]; GVariant *range[2];
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:

View File

@ -587,7 +587,7 @@ SR_PRIV void sr_config_free(struct sr_config *src)
* @param[in] sdi (optional) If the key is specific to a device, this must * @param[in] sdi (optional) If the key is specific to a device, this must
* contain a pointer to the struct sr_dev_inst to be checked. * contain a pointer to the struct sr_dev_inst to be checked.
* Otherwise it must be NULL. * Otherwise it must be NULL.
* @param[in] channel_group The channel group on the device for which to list the * @param[in] cg The channel group on the device for which to list the
* values, or NULL. * values, or NULL.
* @param[in] key The configuration key (SR_CONF_*). * @param[in] key The configuration key (SR_CONF_*).
* @param[in,out] data Pointer to a GVariant where the value will be stored. * @param[in,out] data Pointer to a GVariant where the value will be stored.
@ -604,7 +604,7 @@ SR_PRIV void sr_config_free(struct sr_config *src)
*/ */
SR_API int sr_config_get(const struct sr_dev_driver *driver, SR_API int sr_config_get(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group, const struct sr_channel_group *cg,
int key, GVariant **data) int key, GVariant **data)
{ {
int ret; int ret;
@ -615,7 +615,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver,
if (!driver->config_get) if (!driver->config_get)
return SR_ERR_ARG; return SR_ERR_ARG;
if ((ret = driver->config_get(key, data, sdi, channel_group)) == SR_OK) { if ((ret = driver->config_get(key, data, sdi, cg)) == SR_OK) {
/* Got a floating reference from the driver. Sink it here, /* Got a floating reference from the driver. Sink it here,
* caller will need to unref when done with it. */ * caller will need to unref when done with it. */
g_variant_ref_sink(*data); g_variant_ref_sink(*data);
@ -628,7 +628,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver,
* Set value of a configuration key in a device instance. * Set value of a configuration key in a device instance.
* *
* @param[in] sdi The device instance. * @param[in] sdi The device instance.
* @param[in] channel_group The channel group on the device for which to list the * @param[in] cg The channel group on the device for which to list the
* values, or NULL. * values, or NULL.
* @param[in] key The configuration key (SR_CONF_*). * @param[in] key The configuration key (SR_CONF_*).
* @param data The new value for the key, as a GVariant with GVariantType * @param data The new value for the key, as a GVariant with GVariantType
@ -642,7 +642,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver,
* that it's not applicable. * that it's not applicable.
*/ */
SR_API int sr_config_set(const struct sr_dev_inst *sdi, SR_API int sr_config_set(const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group, const struct sr_channel_group *cg,
int key, GVariant *data) int key, GVariant *data)
{ {
int ret; int ret;
@ -654,7 +654,7 @@ SR_API int sr_config_set(const struct sr_dev_inst *sdi,
else if (!sdi->driver->config_set) else if (!sdi->driver->config_set)
ret = SR_ERR_ARG; ret = SR_ERR_ARG;
else else
ret = sdi->driver->config_set(key, data, sdi, channel_group); ret = sdi->driver->config_set(key, data, sdi, cg);
g_variant_unref(data); g_variant_unref(data);
@ -688,7 +688,7 @@ SR_API int sr_config_commit(const struct sr_dev_inst *sdi)
* @param[in] driver The sr_dev_driver struct to query. * @param[in] driver The sr_dev_driver struct to query.
* @param[in] sdi (optional) If the key is specific to a device, this must * @param[in] sdi (optional) If the key is specific to a device, this must
* contain a pointer to the struct sr_dev_inst to be checked. * contain a pointer to the struct sr_dev_inst to be checked.
* @param[in] channel_group The channel group on the device for which to list the * @param[in] cg The channel group on the device for which to list the
* values, or NULL. * values, or NULL.
* @param[in] key The configuration key (SR_CONF_*). * @param[in] key The configuration key (SR_CONF_*).
* @param[in,out] data A pointer to a GVariant where the list will be stored. * @param[in,out] data A pointer to a GVariant where the list will be stored.
@ -705,7 +705,7 @@ SR_API int sr_config_commit(const struct sr_dev_inst *sdi)
*/ */
SR_API int sr_config_list(const struct sr_dev_driver *driver, SR_API int sr_config_list(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group, const struct sr_channel_group *cg,
int key, GVariant **data) int key, GVariant **data)
{ {
int ret; int ret;
@ -714,7 +714,7 @@ SR_API int sr_config_list(const struct sr_dev_driver *driver,
ret = SR_ERR; ret = SR_ERR;
else if (!driver->config_list) else if (!driver->config_list)
ret = SR_ERR_ARG; ret = SR_ERR_ARG;
else if ((ret = driver->config_list(key, data, sdi, channel_group)) == SR_OK) else if ((ret = driver->config_list(key, data, sdi, cg)) == SR_OK)
g_variant_ref_sink(*data); g_variant_ref_sink(*data);
return ret; return ret;

View File

@ -986,12 +986,12 @@ struct sr_dev_driver {
*/ */
int (*config_get) (int id, GVariant **data, int (*config_get) (int id, GVariant **data,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group); const struct sr_channel_group *cg);
/** Set value of a configuration key in driver or a given device instance. /** Set value of a configuration key in driver or a given device instance.
* @see sr_config_set(). */ * @see sr_config_set(). */
int (*config_set) (int id, GVariant *data, int (*config_set) (int id, GVariant *data,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group); const struct sr_channel_group *cg);
/** Probe status change. /** Probe status change.
* @see sr_dev_probe_enable(), sr_dev_trigger_set(). */ * @see sr_dev_probe_enable(), sr_dev_trigger_set(). */
int (*config_probe_set) (const struct sr_dev_inst *sdi, int (*config_probe_set) (const struct sr_dev_inst *sdi,
@ -1004,7 +1004,7 @@ struct sr_dev_driver {
*/ */
int (*config_list) (int info_id, GVariant **data, int (*config_list) (int info_id, GVariant **data,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group); const struct sr_channel_group *cg);
/* Device-specific */ /* Device-specific */
/** Open device */ /** Open device */

View File

@ -72,15 +72,15 @@ SR_API int sr_driver_init(struct sr_context *ctx,
SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options); SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options);
SR_API int sr_config_get(const struct sr_dev_driver *driver, SR_API int sr_config_get(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group, const struct sr_channel_group *cg,
int key, GVariant **data); int key, GVariant **data);
SR_API int sr_config_set(const struct sr_dev_inst *sdi, SR_API int sr_config_set(const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group, const struct sr_channel_group *cg,
int key, GVariant *data); int key, GVariant *data);
SR_API int sr_config_commit(const struct sr_dev_inst *sdi); SR_API int sr_config_commit(const struct sr_dev_inst *sdi);
SR_API int sr_config_list(const struct sr_dev_driver *driver, SR_API int sr_config_list(const struct sr_dev_driver *driver,
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group, const struct sr_channel_group *cg,
int key, GVariant **data); int key, GVariant **data);
SR_API const struct sr_config_info *sr_config_info_get(int key); SR_API const struct sr_config_info *sr_config_info_get(int key);
SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname); SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname);

View File

@ -211,11 +211,11 @@ static int dev_close(struct sr_dev_inst *sdi)
} }
static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct session_vdev *vdev; struct session_vdev *vdev;
(void)channel_group; (void)cg;
switch (id) { switch (id) {
case SR_CONF_SAMPLERATE: case SR_CONF_SAMPLERATE:
@ -233,11 +233,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
} }
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
struct session_vdev *vdev; struct session_vdev *vdev;
(void)channel_group; (void)cg;
vdev = sdi->priv; vdev = sdi->priv;
@ -270,10 +270,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
} }
static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *channel_group) const struct sr_channel_group *cg)
{ {
(void)sdi; (void)sdi;
(void)channel_group; (void)cg;
switch (key) { switch (key) {
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS: