]> sigrok.org Git - libsigrok.git/blob - src/hardware/dreamsourcelab-dslogic/api.c
dreamsourcelab-dslogic: Don't check for USB manufacturer/product.
[libsigrok.git] / src / hardware / dreamsourcelab-dslogic / api.c
1 /*
2  * This file is part of the libsigrok project.
3  *
4  * Copyright (C) 2013 Bert Vermeulen <bert@biot.com>
5  * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #include <config.h>
22 #include <math.h>
23 #include "protocol.h"
24
25 static const struct dslogic_profile supported_device[] = {
26         /* DreamSourceLab DSLogic */
27         { 0x2a0e, 0x0001, "DreamSourceLab", "DSLogic", NULL,
28                 "dreamsourcelab-dslogic-fx2.fw",
29                 0, "DreamSourceLab", "DSLogic", 256 * 1024 * 1024},
30         /* DreamSourceLab DSCope */
31         { 0x2a0e, 0x0002, "DreamSourceLab", "DSCope", NULL,
32                 "dreamsourcelab-dscope-fx2.fw",
33                 0, "DreamSourceLab", "DSCope", 256 * 1024 * 1024},
34         /* DreamSourceLab DSLogic Pro */
35         { 0x2a0e, 0x0003, "DreamSourceLab", "DSLogic Pro", NULL,
36                 "dreamsourcelab-dslogic-pro-fx2.fw",
37                 0, "DreamSourceLab", "DSLogic", 256 * 1024 * 1024},
38         /* DreamSourceLab DSLogic Plus */
39         { 0x2a0e, 0x0020, "DreamSourceLab", "DSLogic Plus", NULL,
40                 "dreamsourcelab-dslogic-plus-fx2.fw",
41                 0, "DreamSourceLab", "DSLogic", 256 * 1024 * 1024},
42         /* DreamSourceLab DSLogic Basic */
43         { 0x2a0e, 0x0021, "DreamSourceLab", "DSLogic Basic", NULL,
44                 "dreamsourcelab-dslogic-basic-fx2.fw",
45                 0, "DreamSourceLab", "DSLogic", 256 * 1024},
46
47         ALL_ZERO
48 };
49
50 static const uint32_t drvopts[] = {
51         SR_CONF_LOGIC_ANALYZER,
52 };
53
54 static const uint32_t scanopts[] = {
55         SR_CONF_CONN,
56 };
57
58 static const uint32_t devopts[] = {
59         SR_CONF_CONTINUOUS | SR_CONF_SET | SR_CONF_GET,
60         SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
61         SR_CONF_VOLTAGE_THRESHOLD | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
62         SR_CONF_CONN | SR_CONF_GET,
63         SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
64         SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
65         SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
66         SR_CONF_EXTERNAL_CLOCK | SR_CONF_GET | SR_CONF_SET,
67         SR_CONF_CLOCK_EDGE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
68 };
69
70 /* Names assigned to available edge slope choices. */
71 static const char *const signal_edge_names[] = {
72         [DS_EDGE_RISING] = "rising",
73         [DS_EDGE_FALLING] = "falling",
74 };
75
76 static const struct {
77         gdouble low;
78         gdouble high;
79 } voltage_thresholds[] = {
80         { 0.7, 1.4 },
81         { 1.4, 3.6 },
82 };
83
84 static const uint64_t samplerates[] = {
85         SR_KHZ(10),
86         SR_KHZ(20),
87         SR_KHZ(50),
88         SR_KHZ(100),
89         SR_KHZ(200),
90         SR_KHZ(500),
91         SR_MHZ(1),
92         SR_MHZ(2),
93         SR_MHZ(5),
94         SR_MHZ(10),
95         SR_MHZ(20),
96         SR_MHZ(25),
97         SR_MHZ(50),
98         SR_MHZ(100),
99         SR_MHZ(200),
100         SR_MHZ(400),
101 };
102
103 static gboolean is_plausible(const struct libusb_device_descriptor *des)
104 {
105         int i;
106
107         for (i = 0; supported_device[i].vid; i++) {
108                 if (des->idVendor != supported_device[i].vid)
109                         continue;
110                 if (des->idProduct == supported_device[i].pid)
111                         return TRUE;
112         }
113
114         return FALSE;
115 }
116
117 static GSList *scan(struct sr_dev_driver *di, GSList *options)
118 {
119         struct drv_context *drvc;
120         struct dev_context *devc;
121         struct sr_dev_inst *sdi;
122         struct sr_usb_dev_inst *usb;
123         struct sr_channel *ch;
124         struct sr_channel_group *cg;
125         struct sr_config *src;
126         const struct dslogic_profile *prof;
127         GSList *l, *devices, *conn_devices;
128         gboolean has_firmware;
129         struct libusb_device_descriptor des;
130         libusb_device **devlist;
131         struct libusb_device_handle *hdl;
132         int ret, i, j;
133         const char *conn;
134         char manufacturer[64], product[64], serial_num[64], connection_id[64];
135         char channel_name[16];
136
137         drvc = di->context;
138
139         conn = NULL;
140         for (l = options; l; l = l->next) {
141                 src = l->data;
142                 switch (src->key) {
143                 case SR_CONF_CONN:
144                         conn = g_variant_get_string(src->data, NULL);
145                         break;
146                 }
147         }
148         if (conn)
149                 conn_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, conn);
150         else
151                 conn_devices = NULL;
152
153         /* Find all DSLogic compatible devices and upload firmware to them. */
154         devices = NULL;
155         libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
156         for (i = 0; devlist[i]; i++) {
157                 if (conn) {
158                         usb = NULL;
159                         for (l = conn_devices; l; l = l->next) {
160                                 usb = l->data;
161                                 if (usb->bus == libusb_get_bus_number(devlist[i])
162                                         && usb->address == libusb_get_device_address(devlist[i]))
163                                         break;
164                         }
165                         if (!l)
166                                 /* This device matched none of the ones that
167                                  * matched the conn specification. */
168                                 continue;
169                 }
170
171                 libusb_get_device_descriptor(devlist[i], &des);
172
173                 if (!is_plausible(&des))
174                         continue;
175
176                 if ((ret = libusb_open(devlist[i], &hdl)) < 0) {
177                         sr_warn("Failed to open potential device with "
178                                 "VID:PID %04x:%04x: %s.", des.idVendor,
179                                 des.idProduct, libusb_error_name(ret));
180                         continue;
181                 }
182
183                 if (des.iManufacturer == 0) {
184                         manufacturer[0] = '\0';
185                 } else if ((ret = libusb_get_string_descriptor_ascii(hdl,
186                                 des.iManufacturer, (unsigned char *) manufacturer,
187                                 sizeof(manufacturer))) < 0) {
188                         sr_warn("Failed to get manufacturer string descriptor: %s.",
189                                 libusb_error_name(ret));
190                         continue;
191                 }
192
193                 if (des.iProduct == 0) {
194                         product[0] = '\0';
195                 } else if ((ret = libusb_get_string_descriptor_ascii(hdl,
196                                 des.iProduct, (unsigned char *) product,
197                                 sizeof(product))) < 0) {
198                         sr_warn("Failed to get product string descriptor: %s.",
199                                 libusb_error_name(ret));
200                         continue;
201                 }
202
203                 if (des.iSerialNumber == 0) {
204                         serial_num[0] = '\0';
205                 } else if ((ret = libusb_get_string_descriptor_ascii(hdl,
206                                 des.iSerialNumber, (unsigned char *) serial_num,
207                                 sizeof(serial_num))) < 0) {
208                         sr_warn("Failed to get serial number string descriptor: %s.",
209                                 libusb_error_name(ret));
210                         continue;
211                 }
212
213                 usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
214
215                 libusb_close(hdl);
216
217                 prof = NULL;
218                 for (j = 0; supported_device[j].vid; j++) {
219                         if (des.idVendor == supported_device[j].vid &&
220                                         des.idProduct == supported_device[j].pid) {
221                                 prof = &supported_device[j];
222                                 break;
223                         }
224                 }
225
226                 /* Skip if the device was not found. */
227                 if (!prof)
228                         continue;
229
230                 sdi = g_malloc0(sizeof(struct sr_dev_inst));
231                 sdi->status = SR_ST_INITIALIZING;
232                 sdi->vendor = g_strdup(prof->vendor);
233                 sdi->model = g_strdup(prof->model);
234                 sdi->version = g_strdup(prof->model_version);
235                 sdi->serial_num = g_strdup(serial_num);
236                 sdi->connection_id = g_strdup(connection_id);
237
238                 /* Logic channels, all in one channel group. */
239                 cg = g_malloc0(sizeof(struct sr_channel_group));
240                 cg->name = g_strdup("Logic");
241                 for (j = 0; j < 16; j++) {
242                         sprintf(channel_name, "%d", j);
243                         ch = sr_channel_new(sdi, j, SR_CHANNEL_LOGIC,
244                                                 TRUE, channel_name);
245                         cg->channels = g_slist_append(cg->channels, ch);
246                 }
247                 sdi->channel_groups = g_slist_append(NULL, cg);
248
249                 devc = dslogic_dev_new();
250                 devc->profile = prof;
251                 sdi->priv = devc;
252                 devices = g_slist_append(devices, sdi);
253
254                 devc->samplerates = samplerates;
255                 devc->num_samplerates = ARRAY_SIZE(samplerates);
256                 has_firmware = usb_match_manuf_prod(devlist[i], "DreamSourceLab", "USB-based Instrument");
257
258                 if (has_firmware) {
259                         /* Already has the firmware, so fix the new address. */
260                         sr_dbg("Found a DSLogic device.");
261                         sdi->status = SR_ST_INACTIVE;
262                         sdi->inst_type = SR_INST_USB;
263                         sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]),
264                                         libusb_get_device_address(devlist[i]), NULL);
265                 } else {
266                         if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
267                                         USB_CONFIGURATION, prof->firmware) == SR_OK)
268                                 /* Store when this device's FW was updated. */
269                                 devc->fw_updated = g_get_monotonic_time();
270                         else
271                                 sr_err("Firmware upload failed for "
272                                        "device %d.%d (logical).",
273                                        libusb_get_bus_number(devlist[i]),
274                                        libusb_get_device_address(devlist[i]));
275                         sdi->inst_type = SR_INST_USB;
276                         sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]),
277                                         0xff, NULL);
278                 }
279         }
280         libusb_free_device_list(devlist, 1);
281         g_slist_free_full(conn_devices, (GDestroyNotify)sr_usb_dev_inst_free);
282
283         return std_scan_complete(di, devices);
284 }
285
286 static void clear_dev_context(void *priv)
287 {
288         struct dev_context *devc;
289
290         devc = priv;
291         g_free(devc);
292 }
293
294 static int dev_clear(const struct sr_dev_driver *di)
295 {
296         return std_dev_clear(di, clear_dev_context);
297 }
298
299 static int dev_open(struct sr_dev_inst *sdi)
300 {
301         struct sr_dev_driver *di = sdi->driver;
302         struct sr_usb_dev_inst *usb;
303         struct dev_context *devc;
304         int ret;
305         int64_t timediff_us, timediff_ms;
306
307         devc = sdi->priv;
308         usb = sdi->conn;
309
310         /*
311          * If the firmware was recently uploaded, wait up to MAX_RENUM_DELAY_MS
312          * milliseconds for the FX2 to renumerate.
313          */
314         ret = SR_ERR;
315         if (devc->fw_updated > 0) {
316                 sr_info("Waiting for device to reset.");
317                 /* Takes >= 300ms for the FX2 to be gone from the USB bus. */
318                 g_usleep(300 * 1000);
319                 timediff_ms = 0;
320                 while (timediff_ms < MAX_RENUM_DELAY_MS) {
321                         if ((ret = dslogic_dev_open(sdi, di)) == SR_OK)
322                                 break;
323                         g_usleep(100 * 1000);
324
325                         timediff_us = g_get_monotonic_time() - devc->fw_updated;
326                         timediff_ms = timediff_us / 1000;
327                         sr_spew("Waited %" PRIi64 "ms.", timediff_ms);
328                 }
329                 if (ret != SR_OK) {
330                         sr_err("Device failed to renumerate.");
331                         return SR_ERR;
332                 }
333                 sr_info("Device came back after %" PRIi64 "ms.", timediff_ms);
334         } else {
335                 sr_info("Firmware upload was not needed.");
336                 ret = dslogic_dev_open(sdi, di);
337         }
338
339         if (ret != SR_OK) {
340                 sr_err("Unable to open device.");
341                 return SR_ERR;
342         }
343
344         ret = libusb_claim_interface(usb->devhdl, USB_INTERFACE);
345         if (ret != 0) {
346                 switch (ret) {
347                 case LIBUSB_ERROR_BUSY:
348                         sr_err("Unable to claim USB interface. Another "
349                                "program or driver has already claimed it.");
350                         break;
351                 case LIBUSB_ERROR_NO_DEVICE:
352                         sr_err("Device has been disconnected.");
353                         break;
354                 default:
355                         sr_err("Unable to claim interface: %s.",
356                                libusb_error_name(ret));
357                         break;
358                 }
359
360                 return SR_ERR;
361         }
362
363
364         if ((ret = dslogic_fpga_firmware_upload(sdi)) != SR_OK)
365                 return ret;
366
367         if (devc->cur_samplerate == 0) {
368                 /* Samplerate hasn't been set; default to the slowest one. */
369                 devc->cur_samplerate = devc->samplerates[0];
370         }
371
372         if (devc->cur_threshold == 0.0)
373                 devc->cur_threshold = 1.5;
374
375         return SR_OK;
376 }
377
378 static int dev_close(struct sr_dev_inst *sdi)
379 {
380         struct sr_usb_dev_inst *usb;
381
382         usb = sdi->conn;
383
384         if (!usb->devhdl)
385                 return SR_ERR;
386
387         sr_info("Closing device on %d.%d (logical) / %s (physical) interface %d.",
388                 usb->bus, usb->address, sdi->connection_id, USB_INTERFACE);
389         libusb_release_interface(usb->devhdl, USB_INTERFACE);
390         libusb_close(usb->devhdl);
391         usb->devhdl = NULL;
392         sdi->status = SR_ST_INACTIVE;
393
394         return SR_OK;
395 }
396
397 static int config_get(uint32_t key, GVariant **data,
398         const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
399 {
400         struct dev_context *devc;
401         struct sr_usb_dev_inst *usb;
402         GVariant *range[2];
403         unsigned int i, voltage_range;
404         char str[128];
405
406         (void)cg;
407
408         if (!sdi)
409                 return SR_ERR_ARG;
410
411         devc = sdi->priv;
412
413         switch (key) {
414         case SR_CONF_CONN:
415                 if (!sdi->conn)
416                         return SR_ERR_ARG;
417                 usb = sdi->conn;
418                 if (usb->address == 255)
419                         /* Device still needs to re-enumerate after firmware
420                          * upload, so we don't know its (future) address. */
421                         return SR_ERR;
422                 snprintf(str, 128, "%d.%d", usb->bus, usb->address);
423                 *data = g_variant_new_string(str);
424                 break;
425         case SR_CONF_VOLTAGE_THRESHOLD:
426                 if (!strcmp(devc->profile->model, "DSLogic")) {
427                         voltage_range = 0;
428
429                         for (i = 0; i < ARRAY_SIZE(voltage_thresholds); i++)
430                                 if (voltage_thresholds[i].low == devc->cur_threshold) {
431                                         voltage_range = i;
432                                         break;
433                                 }
434
435                         range[0] = g_variant_new_double(
436                                 voltage_thresholds[voltage_range].low);
437                         range[1] = g_variant_new_double(
438                                 voltage_thresholds[voltage_range].high);
439                 } else {
440                         range[0] = g_variant_new_double(devc->cur_threshold);
441                         range[1] = g_variant_new_double(devc->cur_threshold);
442                 }
443                 *data = g_variant_new_tuple(range, 2);
444                 break;
445         case SR_CONF_LIMIT_SAMPLES:
446                 *data = g_variant_new_uint64(devc->limit_samples);
447                 break;
448         case SR_CONF_SAMPLERATE:
449                 *data = g_variant_new_uint64(devc->cur_samplerate);
450                 break;
451         case SR_CONF_CAPTURE_RATIO:
452                 *data = g_variant_new_uint64(devc->capture_ratio);
453                 break;
454         case SR_CONF_EXTERNAL_CLOCK:
455                 *data = g_variant_new_boolean(devc->external_clock);
456                 break;
457         case SR_CONF_CONTINUOUS:
458                 *data = g_variant_new_boolean(devc->continuous_mode);
459                 break;
460         case SR_CONF_CLOCK_EDGE:
461                 i = devc->clock_edge;
462                 if (i >= ARRAY_SIZE(signal_edge_names))
463                         return SR_ERR_BUG;
464                 *data = g_variant_new_string(signal_edge_names[0]);
465                 break;
466         default:
467                 return SR_ERR_NA;
468         }
469
470         return SR_OK;
471 }
472
473 /*
474  * Helper for mapping a string-typed configuration value to an index
475  * within a table of possible values.
476  */
477 static int lookup_index(GVariant *value, const char *const *table, int len)
478 {
479         const char *entry;
480         int i;
481
482         entry = g_variant_get_string(value, NULL);
483         if (!entry)
484                 return -1;
485
486         /* Linear search is fine for very small tables. */
487         for (i = 0; i < len; i++) {
488                 if (strcmp(entry, table[i]) == 0)
489                         return i;
490         }
491
492         return -1;
493 }
494
495 static int config_set(uint32_t key, GVariant *data,
496         const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
497 {
498         struct dev_context *devc;
499         uint64_t arg;
500         int i, ret;
501         gdouble low, high;
502
503         (void)cg;
504
505         if (!sdi)
506                 return SR_ERR_ARG;
507
508         if (sdi->status != SR_ST_ACTIVE)
509                 return SR_ERR;
510
511         devc = sdi->priv;
512
513         ret = SR_OK;
514
515         switch (key) {
516         case SR_CONF_SAMPLERATE:
517                 arg = g_variant_get_uint64(data);
518                 for (i = 0; i < devc->num_samplerates; i++) {
519                         if (devc->samplerates[i] == arg) {
520                                 devc->cur_samplerate = arg;
521                                 break;
522                         }
523                 }
524                 if (i == devc->num_samplerates)
525                         ret = SR_ERR_ARG;
526                 break;
527         case SR_CONF_LIMIT_SAMPLES:
528                 devc->limit_samples = g_variant_get_uint64(data);
529                 break;
530         case SR_CONF_CAPTURE_RATIO:
531                 devc->capture_ratio = g_variant_get_uint64(data);
532                 ret = (devc->capture_ratio > 100) ? SR_ERR : SR_OK;
533                 break;
534         case SR_CONF_VOLTAGE_THRESHOLD:
535                 g_variant_get(data, "(dd)", &low, &high);
536                 if (!strcmp(devc->profile->model, "DSLogic")) {
537                         for (i = 0; (unsigned int)i < ARRAY_SIZE(voltage_thresholds); i++) {
538                                 if (fabs(voltage_thresholds[i].low - low) < 0.1 &&
539                                     fabs(voltage_thresholds[i].high - high) < 0.1) {
540                                         devc->cur_threshold =
541                                                 voltage_thresholds[i].low;
542                                         break;
543                                 }
544                         }
545                         ret = dslogic_fpga_firmware_upload(sdi);
546                 } else {
547                         ret = dslogic_set_voltage_threshold(sdi, (low + high) / 2.0);
548                 }
549                 break;
550         case SR_CONF_EXTERNAL_CLOCK:
551                 devc->external_clock = g_variant_get_boolean(data);
552                 break;
553         case SR_CONF_CONTINUOUS:
554                 devc->continuous_mode = g_variant_get_boolean(data);
555                 break;
556         case SR_CONF_CLOCK_EDGE:
557                 i = lookup_index(data, signal_edge_names,
558                                    ARRAY_SIZE(signal_edge_names));
559                 if (i < 0)
560                         return SR_ERR_ARG;
561                 devc->clock_edge = i;
562                 break;
563         default:
564                 ret = SR_ERR_NA;
565         }
566
567         return ret;
568 }
569
570 static int config_list(uint32_t key, GVariant **data,
571         const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
572 {
573         struct dev_context *devc = NULL;
574         GVariant *gvar, *range[2];
575         GVariantBuilder gvb;
576         unsigned int i;
577         double v;
578
579         (void)cg;
580
581         switch (key) {
582         case SR_CONF_SCAN_OPTIONS:
583                 *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
584                                 scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
585                 break;
586         case SR_CONF_DEVICE_OPTIONS:
587                 if (!sdi) {
588                         *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
589                                 drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
590                 } else {
591                         devc = sdi->priv;
592                         *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
593                                                           devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
594                 }
595                 break;
596         case SR_CONF_VOLTAGE_THRESHOLD:
597                 if (sdi->priv)
598                         devc = sdi->priv;
599                 g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
600                 if (devc && !strcmp(devc->profile->model, "DSLogic")) {
601                         for (i = 0; i < ARRAY_SIZE(voltage_thresholds); i++) {
602                                 range[0] = g_variant_new_double(voltage_thresholds[i].low);
603                                 range[1] = g_variant_new_double(voltage_thresholds[i].high);
604                                 gvar = g_variant_new_tuple(range, 2);
605                                 g_variant_builder_add_value(&gvb, gvar);
606                         }
607                 } else {
608                         for (v = 0.0; v <= 5.0; v += 0.1) {
609                                 range[0] = g_variant_new_double(v);
610                                 range[1] = g_variant_new_double(v);
611                                 gvar = g_variant_new_tuple(range, 2);
612                                 g_variant_builder_add_value(&gvb, gvar);
613                         }
614                 }
615                 *data = g_variant_builder_end(&gvb);
616                 break;
617         case SR_CONF_SAMPLERATE:
618                 devc = sdi->priv;
619                 g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
620                 gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"), devc->samplerates,
621                                 devc->num_samplerates, sizeof(uint64_t));
622                 g_variant_builder_add(&gvb, "{sv}", "samplerates", gvar);
623                 *data = g_variant_builder_end(&gvb);
624                 break;
625         case SR_CONF_CLOCK_EDGE:
626                 *data = g_variant_new_strv(signal_edge_names,
627                         ARRAY_SIZE(signal_edge_names));
628                 break;
629         default:
630                 return SR_ERR_NA;
631         }
632
633         return SR_OK;
634 }
635
636 static struct sr_dev_driver dreamsourcelab_dslogic_driver_info = {
637         .name = "dreamsourcelab-dslogic",
638         .longname = "DreamSourceLab DSLogic",
639         .api_version = 1,
640         .init = std_init,
641         .cleanup = std_cleanup,
642         .scan = scan,
643         .dev_list = std_dev_list,
644         .dev_clear = dev_clear,
645         .config_get = config_get,
646         .config_set = config_set,
647         .config_list = config_list,
648         .dev_open = dev_open,
649         .dev_close = dev_close,
650         .dev_acquisition_start = dslogic_acquisition_start,
651         .dev_acquisition_stop = dslogic_acquisition_stop,
652         .context = NULL,
653 };
654 SR_REGISTER_DEV_DRIVER(dreamsourcelab_dslogic_driver_info);