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:
parent
84b448ee06
commit
b6085eb179
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue