+ /*
+ * If this device has analog channels and at least one of them is
+ * enabled, use mso_send_data_proc() to properly handle the analog
+ * data. Otherwise use la_send_data_proc().
+ */
+ if (g_slist_length(devc->enabled_analog_channels) > 0)
+ devc->send_data_proc = mso_send_data_proc;
+ else
+ devc->send_data_proc = la_send_data_proc;
+
+ std_session_send_df_header(sdi);
+
+ return SR_OK;
+}
+
+static int configure_channels(const struct sr_dev_inst *sdi)
+{
+ struct dev_context *devc;
+ const GSList *l;
+ int p;
+ struct sr_channel *ch;
+ uint32_t channel_mask = 0, num_analog = 0;
+
+ devc = sdi->priv;
+
+ g_slist_free(devc->enabled_analog_channels);
+ devc->enabled_analog_channels = NULL;
+
+ for (l = sdi->channels, p = 0; l; l = l->next, p++) {
+ ch = l->data;
+ if ((p <= NUM_CHANNELS) && (ch->type == SR_CHANNEL_ANALOG)
+ && (ch->enabled)) {
+ num_analog++;
+ devc->enabled_analog_channels =
+ g_slist_append(devc->enabled_analog_channels, ch);
+ } else {
+ channel_mask |= ch->enabled << p;
+ }
+ }
+
+ /*
+ * Use wide sampling if either any of the LA channels 8..15 is enabled,
+ * and/or at least one analog channel is enabled.
+ */
+ devc->sample_wide = channel_mask > 0xff || num_analog > 0;
+
+ return SR_OK;
+}
+
+static int dev_acquisition_start(const struct sr_dev_inst *sdi)
+{
+ struct sr_dev_driver *di;
+ struct drv_context *drvc;
+ struct dev_context *devc;
+ int timeout, ret;
+ size_t size;
+
+ if (sdi->status != SR_ST_ACTIVE)
+ return SR_ERR_DEV_CLOSED;
+
+ di = sdi->driver;
+ drvc = di->context;
+ devc = sdi->priv;
+