ops[1] = mso_trans(REG_CTL1, ctx->ctlbase1);
ctx->ctlbase1 |= BIT_CTL1_ADC_UNKNOWN4;
ops[1] = mso_trans(REG_CTL1, ctx->ctlbase1);
ctx->ctlbase1 |= BIT_CTL1_ADC_UNKNOWN4;
ctx->ctlbase1 |= BIT_CTL1_RESETFSM;
ops[0] = mso_trans(REG_CTL1, ctx->ctlbase1);
ctx->ctlbase1 |= BIT_CTL1_RESETFSM;
ops[0] = mso_trans(REG_CTL1, ctx->ctlbase1);
ctx->ctlbase1 |= BIT_CTL1_LED;
ops[0] = mso_trans(REG_CTL1, ctx->ctlbase1);
ctx->ctlbase1 |= BIT_CTL1_LED;
ops[0] = mso_trans(REG_CTL1, ctx->ctlbase1);
ret = mso_send_control_message(sdi, ARRAY_AND_SIZE(ops));
if (info == NULL || ret != SR_OK)
return ret;
ret = mso_send_control_message(sdi, ARRAY_AND_SIZE(ops));
if (info == NULL || ret != SR_OK)
return ret;
/* It's easier to map usb<->serial using udev */
/*
* FIXME: On windows we can get the same information from the
/* It's easier to map usb<->serial using udev */
/*
* FIXME: On windows we can get the same information from the
parent = udev_device_get_parent_with_subsystem_devtype(
dev, "usb", "usb_device");
if (!parent) {
parent = udev_device_get_parent_with_subsystem_devtype(
dev, "usb", "usb_device");
if (!parent) {
s = strcspn(iProduct, " ");
if (s > sizeof(product) ||
strlen(iProduct) - s > sizeof(manufacturer)) {
s = strcspn(iProduct, " ");
if (s > sizeof(product) ||
strlen(iProduct) - s > sizeof(manufacturer)) {
strcpy(manufacturer, iProduct + s);
if (!(ctx = g_try_malloc0(sizeof(struct context)))) {
strcpy(manufacturer, iProduct + s);
if (!(ctx = g_try_malloc0(sizeof(struct context)))) {
continue; /* TODO: Errors handled correctly? */
}
if (mso_parse_serial(iSerial, iProduct, ctx) != SR_OK) {
continue; /* TODO: Errors handled correctly? */
}
if (mso_parse_serial(iSerial, iProduct, ctx) != SR_OK) {
sdi = sr_dev_inst_new(devcnt, SR_ST_INITIALIZING,
manufacturer, product, hwrev);
if (!sdi) {
sdi = sr_dev_inst_new(devcnt, SR_ST_INITIALIZING,
manufacturer, product, hwrev);
if (!sdi) {
for (l = dev_insts; l; l = l->next) {
if (!(sdi = l->data)) {
/* Log error, but continue cleaning up the rest. */
for (l = dev_insts; l; l = l->next) {
if (!(sdi = l->data)) {
/* Log error, but continue cleaning up the rest. */
/* FIXME: discard serial buffer */
mso_check_trigger(sdi, &ctx->trigger_state);
/* FIXME: discard serial buffer */
mso_check_trigger(sdi, &ctx->trigger_state);
ret = mso_reset_adc(sdi);
if (ret != SR_OK)
return ret;
mso_check_trigger(sdi, &ctx->trigger_state);
ret = mso_reset_adc(sdi);
if (ret != SR_OK)
return ret;
mso_check_trigger(sdi, &ctx->trigger_state);
.dev_open = hw_dev_open,
.dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,
.dev_open = hw_dev_open,
.dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,