manson-hcs-3xxx: Fix incorrect SR_CONF_SCAN_OPTIONS handling.

The SR_CONF_SCAN_OPTIONS key must be listable with or without sdi,
otherwise the device will not be detected by frontends.
This commit is contained in:
Uwe Hermann 2014-11-23 21:09:37 +01:00
parent 84b448ee06
commit b6085eb179
1 changed files with 9 additions and 4 deletions

View File

@ -330,21 +330,26 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
(void)cg;
/* Always available (with or without sdi). */
if (key == SR_CONF_SCAN_OPTIONS) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
return SR_OK;
}
/* Return drvopts without sdi (and devopts with sdi, see below). */
if (key == SR_CONF_DEVICE_OPTIONS && !sdi) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
return SR_OK;
}
/* Every other key needs an sdi. */
if (!sdi)
return SR_ERR_ARG;
devc = sdi->priv;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));